diff --git a/COM380/Project5/GambleKit/CustomGameLogic/CustomGame.cpp b/COM380/Project5/GambleKit/CustomGameLogic/CustomGame.cpp index 1f92c64..c39d563 100644 --- a/COM380/Project5/GambleKit/CustomGameLogic/CustomGame.cpp +++ b/COM380/Project5/GambleKit/CustomGameLogic/CustomGame.cpp @@ -14,6 +14,7 @@ CustomGame::CustomGame(GkGraphicsDevice *graphicsDevice, GkSoundDevice *soundDev //this->settings = new Settings(CustomGame::settingsFileName, this); this->AddGamePage(new MainPage(this)); + } diff --git a/COM380/Project5/GambleKit/CustomGameLogic/MainWindow.cpp b/COM380/Project5/GambleKit/CustomGameLogic/MainWindow.cpp index f08e7ca..94cca02 100644 --- a/COM380/Project5/GambleKit/CustomGameLogic/MainWindow.cpp +++ b/COM380/Project5/GambleKit/CustomGameLogic/MainWindow.cpp @@ -73,6 +73,8 @@ void MainWindow::Resize(int width, int height) void MainWindow::KeyDown(int keyCode) { + if (keyCode == VK_SPACE) + if (keyCode == VK_ESCAPE) this->DestroyFormWindow(); } \ No newline at end of file diff --git a/COM380/Project5/GambleKit/CustomGameLogic/Pages/MainPage.cpp b/COM380/Project5/GambleKit/CustomGameLogic/Pages/MainPage.cpp index 19934c7..db9d3a5 100644 --- a/COM380/Project5/GambleKit/CustomGameLogic/Pages/MainPage.cpp +++ b/COM380/Project5/GambleKit/CustomGameLogic/Pages/MainPage.cpp @@ -41,18 +41,23 @@ MainPage::MainPage(CustomGame *game) // Create the combinations generator. The combinations generator represents a model of collection of reels. Each of its reels can have a different model // The GkGameReelStripModel is a GkGameReelModel, representing a reel with a fixed sequence of finite number of items. Here, it is used for all the reels of the combination generator. this->combinationsGenerator = new GkGameReelsCombinationGenerator(5, 3); - this->combinationsGenerator->SetReelModel(0, new GkGameReelStripModel(3, 6, ReelItem_Cherry, ReelItem_Melon, ReelItem_Cherry, ReelItem_Bell, ReelItem_Cherry, ReelItem_Melon)); - this->combinationsGenerator->SetReelModel(1, new GkGameReelStripModel(3, 6, ReelItem_Bell, ReelItem_Melon, ReelItem_Bell, ReelItem_Melon, ReelItem_Melon, ReelItem_Cherry)); - this->combinationsGenerator->SetReelModel(2, new GkGameReelStripModel(3, 6, ReelItem_Cherry, ReelItem_7, ReelItem_Melon, ReelItem_Cherry, ReelItem_7, ReelItem_Bell)); - this->combinationsGenerator->SetReelModel(3, new GkGameReelStripModel(3, 6, ReelItem_Cherry, ReelItem_Bell, ReelItem_Melon, ReelItem_Bell, ReelItem_Cherry, ReelItem_Bell)); - this->combinationsGenerator->SetReelModel(4, new GkGameReelStripModel(3, 6, ReelItem_Cherry, ReelItem_Melon, ReelItem_Bell, ReelItem_Cherry, ReelItem_Melon, ReelItem_Bell)); + this->combinationsGenerator->SetReelModel(0, new GkGameReelStripModel(3, 6, ReelItem_Cherry, ReelItem_Space, ReelItem_Cherry, ReelItem_Grape, ReelItem_Cherry, ReelItem_Lemon)); + this->combinationsGenerator->SetReelModel(1, new GkGameReelStripModel(3, 6, ReelItem_Grape, ReelItem_Lemon, ReelItem_Space, ReelItem_Lemon, ReelItem_Lemon, ReelItem_Cherry)); + this->combinationsGenerator->SetReelModel(2, new GkGameReelStripModel(3, 6, ReelItem_Cherry, ReelItem_7, ReelItem_Lemon, ReelItem_Cherry, ReelItem_7, ReelItem_Space)); + this->combinationsGenerator->SetReelModel(3, new GkGameReelStripModel(3, 6, ReelItem_Cherry, ReelItem_Bar1, ReelItem_Bar2, ReelItem_Space, ReelItem_Cherry, ReelItem_Grape)); + this->combinationsGenerator->SetReelModel(4, new GkGameReelStripModel(3, 6, ReelItem_Cherry, ReelItem_Space, ReelItem_Bar3, ReelItem_Cherry, ReelItem_Lemon, ReelItem_Grape)); // Create the visual object for the reels - this->reels = (GkGameReels*)this->AddEntity(new GkGameReels(5, 3, 4, 670, 331)); + this->reels = (GkGameReels*)this->AddEntity(new GkGameReels(5, 3, 8, 670, 331)); + this->reels->symbols[ReelItem_Space ] = game->AcquireAnimatedTexture(L"symbol_space.png"); this->reels->symbols[ReelItem_Cherry] = game->AcquireAnimatedTexture(L"symbol_cherry.png"); - this->reels->symbols[ReelItem_Melon ] = game->AcquireAnimatedTexture(L"symbol_melon.png"); - this->reels->symbols[ReelItem_Bell ] = game->AcquireAnimatedTexture(L"symbol_bell.png"); - this->reels->symbols[ReelItem_7 ] = game->AcquireAnimatedTexture(L"symbol_7.png"); + this->reels->symbols[ReelItem_Grape ] = game->AcquireAnimatedTexture(L"symbol_grape.png"); + this->reels->symbols[ReelItem_Lemon ] = game->AcquireAnimatedTexture(L"symbol_lemon.png"); + this->reels->symbols[ReelItem_7 ] = game->AcquireAnimatedTexture(L"symbol_seven.png"); + this->reels->symbols[ReelItem_Bar1 ] = game->AcquireAnimatedTexture(L"symbol_bar1.png"); + this->reels->symbols[ReelItem_Bar2 ] = game->AcquireAnimatedTexture(L"symbol_bar2.png"); + this->reels->symbols[ReelItem_Bar3 ] = game->AcquireAnimatedTexture(L"symbol_bar3.png"); + this->reels->x = 62; this->reels->y = 90; this->reels->ApplyReelMap();// (this->game->settings->playerSettings->currentMap); @@ -66,11 +71,15 @@ MainPage::MainPage(CustomGame *game) this->lineAnimations[4] = (GkGameAnimation*)this->AddEntity(new GkGameAnimation(game->AcquireAnimatedTexture(L"line45.png"), 112, 139, true, true, true, false, true)); // The winnings model defines two things. One is the properties of the symbols - their coefficients and special behaviour. Second - the shape of the winning lines. - this->winningsModel = new GkGameWinningsModel(5, 3, 5, 4, 0); - this->winningsModel->SetupSymbol(ReelItem_Cherry, 0, GkGameWinningsModel::SymbolFlag_Default, GkGameWinningsModel::SymbolFlag_None, 0, 0, 10, 20, 80); - this->winningsModel->SetupSymbol(ReelItem_Melon , 0, GkGameWinningsModel::SymbolFlag_Default, GkGameWinningsModel::SymbolFlag_None, 0, 0, 20, 40, 200); - this->winningsModel->SetupSymbol(ReelItem_Bell , 0, GkGameWinningsModel::SymbolFlag_Default, GkGameWinningsModel::SymbolFlag_None, 0, 0, 50, 100, 500); - this->winningsModel->SetupSymbol(ReelItem_7 , 0, GkGameWinningsModel::SymbolFlag_Wild, GkGameWinningsModel::SymbolFlag_None, 0, 0, 0, 0, 0); + this->winningsModel = new GkGameWinningsModel(5, 3, 5, 8, 0); + this->winningsModel->SetupSymbol(ReelItem_Space , 0, GkGameWinningsModel::SymbolFlag_Default, GkGameWinningsModel::SymbolFlag_None, 0, 0, 0, 0, 0); + this->winningsModel->SetupSymbol(ReelItem_Cherry, 0, GkGameWinningsModel::SymbolFlag_Wild, GkGameWinningsModel::SymbolFlag_None, 0, 0, 10, 20, 80); + this->winningsModel->SetupSymbol(ReelItem_Grape , 0, GkGameWinningsModel::SymbolFlag_Default, GkGameWinningsModel::SymbolFlag_None, 0, 0, 20, 40, 200); + this->winningsModel->SetupSymbol(ReelItem_Lemon , 0, GkGameWinningsModel::SymbolFlag_Default, GkGameWinningsModel::SymbolFlag_None, 0, 0, 50, 100, 500); + this->winningsModel->SetupSymbol(ReelItem_7 , 0, GkGameWinningsModel::SymbolFlag_Default, GkGameWinningsModel::SymbolFlag_Wild, 0, 0, 1000, 10000, 100000); + this->winningsModel->SetupSymbol(ReelItem_Bar1 , 0, GkGameWinningsModel::SymbolFlag_Default, GkGameWinningsModel::SymbolFlag_Wild, 0, 0, 1000, 10000, 100000); + this->winningsModel->SetupSymbol(ReelItem_Bar2 , 0, GkGameWinningsModel::SymbolFlag_Default, GkGameWinningsModel::SymbolFlag_Wild, 0, 0, 1000, 10000, 100000); + this->winningsModel->SetupSymbol(ReelItem_Bar3 , 0, GkGameWinningsModel::SymbolFlag_Default, GkGameWinningsModel::SymbolFlag_Wild, 0, 0, 1000, 10000, 100000); this->winningsModel->SetupLine(0, 1, 1, 1, 1, 1); this->winningsModel->SetupLine(1, 0, 0, 0, 0, 0); this->winningsModel->SetupLine(2, 2, 2, 2, 2, 2); @@ -82,6 +91,8 @@ MainPage::MainPage(CustomGame *game) this->sndReels = game->AcquireSoundSource(L"reels.wav"); this->sndReelStop = game->AcquireSoundSource(L"reel.wav"); + this->sndBlip = game->AcquireSoundSource(L"start.wav"); + game->soundDevice->PlaySource(this->sndBlip); } @@ -118,6 +129,8 @@ void MainPage::Process(GkGame *game) if (this->btnBet->IsClicked()) { this->bet = this->bet % 10 + 1; + game->soundDevice->PlaySource(this->sndBlip); + } // Lines button - set which lines in the winnings model are active @@ -127,6 +140,8 @@ void MainPage::Process(GkGame *game) for (int lineIndex = 0; lineIndex < this->winningsModel->numLines; lineIndex++) this->winningsModel->lines[lineIndex].active = lineIndex < this->lines; + + game->soundDevice->PlaySource(this->sndBlip); } } diff --git a/COM380/Project5/GambleKit/CustomGameLogic/Pages/MainPage.h b/COM380/Project5/GambleKit/CustomGameLogic/Pages/MainPage.h index b22ed9b..3e75de6 100644 --- a/COM380/Project5/GambleKit/CustomGameLogic/Pages/MainPage.h +++ b/COM380/Project5/GambleKit/CustomGameLogic/Pages/MainPage.h @@ -7,10 +7,14 @@ class MainPage : { public: - static const int ReelItem_Cherry = 0, - ReelItem_Melon = 1, - ReelItem_Bell = 2, - ReelItem_7 = 3; + static const int ReelItem_Space = 0, + ReelItem_Cherry = 1, + ReelItem_Grape = 2, + ReelItem_Lemon = 3, + ReelItem_7 = 4, + ReelItem_Bar1 = 5, + ReelItem_Bar2 = 6, + ReelItem_Bar3 = 7; GkGameClickButton *btnStart, *btnBet, *btnLines; @@ -27,7 +31,8 @@ public: int bet, lines, winning, credits; - GkSoundSource *sndReels, *sndReelStop; + GkSoundSource *sndReels, *sndReelStop, *sndBlip; + MainPage(CustomGame *game); ~MainPage(void); diff --git a/COM380/Project5/GameData/Thumbs.db b/COM380/Project5/GameData/Thumbs.db index ed103de..2ad1074 100644 Binary files a/COM380/Project5/GameData/Thumbs.db and b/COM380/Project5/GameData/Thumbs.db differ diff --git a/COM380/Project5/GameData/lemon.xcf b/COM380/Project5/GameData/lemon.xcf new file mode 100644 index 0000000..cd7f3db Binary files /dev/null and b/COM380/Project5/GameData/lemon.xcf differ diff --git a/COM380/Project5/GameData/symbol_1bar.png b/COM380/Project5/GameData/symbol_1bar.png new file mode 100644 index 0000000..1c18667 Binary files /dev/null and b/COM380/Project5/GameData/symbol_1bar.png differ diff --git a/COM380/Project5/GameData/symbol_2bar.png b/COM380/Project5/GameData/symbol_2bar.png new file mode 100644 index 0000000..dc0579a Binary files /dev/null and b/COM380/Project5/GameData/symbol_2bar.png differ diff --git a/COM380/Project5/GameData/symbol_3bar.png b/COM380/Project5/GameData/symbol_3bar.png new file mode 100644 index 0000000..240852c Binary files /dev/null and b/COM380/Project5/GameData/symbol_3bar.png differ diff --git a/COM380/Project5/GameData/symbol_7.png b/COM380/Project5/GameData/symbol_7.png deleted file mode 100644 index 1fdf442..0000000 Binary files a/COM380/Project5/GameData/symbol_7.png and /dev/null differ diff --git a/COM380/Project5/GameData/symbol_cherry.png b/COM380/Project5/GameData/symbol_cherry.png index c4afef2..794bf61 100644 Binary files a/COM380/Project5/GameData/symbol_cherry.png and b/COM380/Project5/GameData/symbol_cherry.png differ diff --git a/COM380/Project5/GameData/symbol_grape.png b/COM380/Project5/GameData/symbol_grape.png new file mode 100644 index 0000000..70337dc Binary files /dev/null and b/COM380/Project5/GameData/symbol_grape.png differ diff --git a/COM380/Project5/GameData/symbol_lemon.png b/COM380/Project5/GameData/symbol_lemon.png new file mode 100644 index 0000000..3e1c576 Binary files /dev/null and b/COM380/Project5/GameData/symbol_lemon.png differ diff --git a/COM380/Project5/GameData/symbol_seven.png b/COM380/Project5/GameData/symbol_seven.png new file mode 100644 index 0000000..a94f167 Binary files /dev/null and b/COM380/Project5/GameData/symbol_seven.png differ diff --git a/COM380/Project5/GameData/symbol_space.png b/COM380/Project5/GameData/symbol_space.png new file mode 100644 index 0000000..714315b Binary files /dev/null and b/COM380/Project5/GameData/symbol_space.png differ