From 6eda55cdae704ae193f692285115631f9f5b1671 Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Wed, 5 Oct 2022 10:22:38 +0200 Subject: [PATCH] =?UTF-8?q?Redistribuci=C3=B3n=20de=20los=20graficos=20de?= =?UTF-8?q?=20fondo=20en=20varios=20png?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/gfx/game_bg.png | Bin 14705 -> 0 bytes data/gfx/game_buildings.png | Bin 0 -> 9063 bytes data/gfx/game_clouds.png | Bin 0 -> 901 bytes data/gfx/game_grass.png | Bin 0 -> 468 bytes data/gfx/game_power_meter.png | Bin 0 -> 270 bytes data/gfx/game_sky_colors.png | Bin 0 -> 2608 bytes data/gfx/game_text.png | Bin 795 -> 438 bytes data/gfx/items.png | Bin 2356 -> 1797 bytes source/director.cpp | 9 +- source/game.cpp | 753 +++++++++++++++++----------------- source/game.h | 143 +++---- todo.txt | 2 +- 12 files changed, 444 insertions(+), 463 deletions(-) delete mode 100644 data/gfx/game_bg.png create mode 100644 data/gfx/game_buildings.png create mode 100644 data/gfx/game_clouds.png create mode 100644 data/gfx/game_grass.png create mode 100644 data/gfx/game_power_meter.png create mode 100644 data/gfx/game_sky_colors.png diff --git a/data/gfx/game_bg.png b/data/gfx/game_bg.png deleted file mode 100644 index 35b72c1a39d16b1910673b6d07927c59e0ca9817..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14705 zcmd_RXH-*N*Dkyh5{lB1A~i}=stAfwV?hW-q)G=xKtMpG*91^eks_!F(xi8g-UBui zqzKZ58rFNmM1?nR)oUw8=s5CH1(1@qvHwdt@VySb2s-;Tt( zq*V;;32Vc*k7naTJ+tG*rcR11IeMrP8CxW`&zpBTA>tpqI=KnlOgFoAn0cL_J{A$y zx08|eDlorx{I`_V+?|q|%tIcxXBe&_0e`>VpikAn)1SCmI3kn z^ak;g$W>!w;!<8(R%8}2L{axZ)jxj>#g@A)0J71@&`{<5I85D53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IQ#R_|6@xKYk&8n3>k|3Y zGg2X(x)HBV3HrXjlvq4mx~F0OvxUDNk%PaabQy#l(9g1+Q}3V>>TS{6}?B2w^2 zAvOYzG%t#hFPn)H{86ZlfioQOEsJN1dC>wt7kcC1EPK4cI(pav000000000000000 z0001h;F^Df$sS*)Dfww9_(n5>w!~+s6a&$vADj`sKc@(YD)pzqB7}dm$4e(+Z)s+w zNMRpE{1608RW~T32YpWPiL8pj88P%-XNISKKczR|6VsrT{?6NcwikSAR^8xzwwShe zF*vNJ1!)HI5v%Ni4gf$t4ski$5m#~CUAYfCkdH*Y6g#IF*0H1bPc318M;W}A`dI+h zx!>=PEa4w{2II9VZUo|ZS%Tt5t##}i{uzehQTk5HPq|TRA9fVKL^=g{74ohV^gY;t zjfxcXu6rJKAwQNifQCd1{hY9$PXRO}(o>aP_x=!{<7wPRo%K{@*IBTO%+BYRqb>&u bdQ5)-!^F!a1fKFR00000NkvXXu0mjfn1zPN literal 0 HcmV?d00001 diff --git a/data/gfx/game_grass.png b/data/gfx/game_grass.png new file mode 100644 index 0000000000000000000000000000000000000000..720ae32ca1a9e68ced01104eea9efeeadb2fb74d GIT binary patch literal 468 zcmV;_0W1EAP)Px$j!8s8RA_CV0w0+wgG@|gFkIR3>84$srefFS&dt#fDVa^z2N}?s2nG3yM{kx`S)^V%Hw_ycDr3*9%1DQV%IU zKaaN2u~Rw`h`u9!)@VV(JlfSAR~Fn&ygFXw>2dF5`t$VMn0X;NTl0KfXIB~eKge0Z zfa7SNmY~-D<3A70CyMj&95xFj^%tQX2Px#$Vo&&R7i>Cl|c@IFc3vwjT@KFLEL#M59FoXd601_#fI+!&;hn2miQCsYiXL# zXIc`2++9>8GfS~wtG_+;=H`Zft?0?!b>uR6uC}12Kz^YdxG5+X$OSd8B{u~mltFC@ z7bwsAZ3<)4`J=ymjp0H6g~zI!hX;U$n??>Tfb<=U%sPeqJe_fO?N(XskG07FCG}O+ zMOM$EVghACvXgH#kV}%Zl!4uU_D1cYY{M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`4F%|-rqK1B%PAw|Q-D%cO+S@!a}vO-`cH})E3lM{N7A)X`2$V!!PVxS znDcy#2X+v1Ufi431Jf7|Ow7xH@~yJp+|NB~0krwkhC5c88AJmcNtX{WIE*q3!7C;5 z9DZXC5J^@w<9LdFt>FspcSB&r?sd2VYWRn2JBhHnn%ho^1H49_v&6QIj);h@YmmE= z*Tx39fV9t57I_$rfrNRu%){>eKwb4tNJstKkzfX#$Su))a&@3zk&QmAQ&IFxK2%OY zZcShtl6qx16MUjfA#v4Zt?MxhV22yPWhNv#>cJ`o6iF%ChJrPC(<}txaaUUBX(enT z1JW-=3Bm_+dKh$+8iXl8&lJN+VrBtNB(x*$1S1s2Bp7H+YzCu840Rww)gpTQ#; literal 0 HcmV?d00001 diff --git a/data/gfx/game_text.png b/data/gfx/game_text.png index f10bb203821f4eaf5f1c6f5289b11f9d8846b274..c647ffb1070476e89da3c6018ebb12ced92c22bb 100644 GIT binary patch literal 438 zcmV;n0ZIOeP)Px$a7jc#R7i=nRwW|?tJ!{;0(dI0)V_J2^?sj>kr|_Xocu)H#>ZPe05?0 zAgz@6`KiDR z5L?I7*N~pQ&$oY!JrK(ja?1P`c~g=!UaPDwFgNn1ByJb_V4o$8*Fl=TSgU0c6w`;r z;V98`vYtnfLYsIC~y0H+H>f+`AnH#??0Y~Z$Q|uUkE=I*XW(6vrmsW gyt~$%@BUu?4~W9Gfu5xb+5i9m07*qoM6N<$f^6Z*A^-pY literal 795 zcmV+$1LXXPP)00001b5ch_0Itp) z=>Px%)k#D_RA_a+7Ox#ng;2w1)O zZc*Zp$IvBg5ABH6c=lgbBDx=hNTb@f)5V6umh>7n&n|_0tuY#^ZLLg_Zrbl;dTJ&@$ zeF{zwIbBz|SZO1KvC^0*Rb5SebW_=zI7^yt_~`FRdv`_UI=2PjSy|6?Oxtl z1sD1K7e+A=*lte?4OrT;!%6rQ$Myjx+TS zAKzSilA(DLBMR8zDZ;iSPe}(3ALB zX(PnZ+Rx3hoEfTq;VQSW6=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6t6|i$uUh|n}55JSmgs8{j2{@1l`LA7|Q^FluRa71?PwDP&f!EK?xyDoh2zrPV~8^|x6d{<5b11w%xCWJJu>?m5m`1SsRpAF=D zFW)vJXnSXiY285IkZpaj2;_S!UuX+>>)G6S`n9hQtA8wx{bjdheX%IFe7pV^^Z12w z0{4ED%c!YYzmr?P^~pn)^~Ivx^6mOx%;Oib0Co(sV`#Ck>wl@s_tF9hSpYkR*)g@f8e}RY2@edAg9bZgb6UvH-v{DeOSFu zy)vm@v*iHr#phoX{6c~J(#m&a0lXMkAiuowg$Pgy-@}zEKZpZVIJg$T$&VPkKp?+# a^8XKdcX#|Ry-s5Q0000add("data/gfx/balloon4.png", t_bitmap); asset->add("data/gfx/balloon4.ani", t_data); asset->add("data/gfx/bullet.png", t_bitmap); - asset->add("data/gfx/game_bg.png", t_bitmap); + + asset->add("data/gfx/game_buildings.png", t_bitmap); + asset->add("data/gfx/game_clouds.png", t_bitmap); + asset->add("data/gfx/game_grass.png", t_bitmap); + asset->add("data/gfx/game_power_meter.png", t_bitmap); + asset->add("data/gfx/game_sky_colors.png", t_bitmap); asset->add("data/gfx/game_text.png", t_bitmap); + asset->add("data/gfx/intro.png", t_bitmap); asset->add("data/gfx/logo.png", t_bitmap); + asset->add("data/gfx/items.png", t_bitmap); asset->add("data/gfx/item_points1_disk.png", t_bitmap); asset->add("data/gfx/item_points1_disk.ani", t_data); diff --git a/source/game.cpp b/source/game.cpp index 9364e04..5c84428 100644 --- a/source/game.cpp +++ b/source/game.cpp @@ -1,15 +1,15 @@ #include "game.h" // Constructor -Game::Game(int numPlayers, int currentStage, SDL_Renderer *renderer, Screen *screen, Asset *mAsset, Lang *lang, Input *input, bool demo, options_t *options) +Game::Game(int numPlayers, int currentStage, SDL_Renderer *renderer, Screen *screen, Asset *asset, Lang *lang, Input *input, bool demo, options_t *options) { // Copia los punteros - mRenderer = renderer; - mScreen = screen; - this->mAsset = mAsset; - mLang = lang; - mInput = input; - mOptions = options; + this->renderer = renderer; + this->screen = screen; + this->asset = asset; + this->lang = lang; + this->input = input; + this->mOptions = options; mOnePlayerControl = mOptions->input[0].deviceType; // Pasa variables @@ -24,52 +24,56 @@ Game::Game(int numPlayers, int currentStage, SDL_Renderer *renderer, Screen *scr mDifficulty = mOptions->difficulty; // Crea los objetos - balloon1Texture = new LTexture(mRenderer, mAsset->get("balloon1.png")); - balloon2Texture = new LTexture(mRenderer, mAsset->get("balloon2.png")); - balloon3Texture = new LTexture(mRenderer, mAsset->get("balloon3.png")); - balloon4Texture = new LTexture(mRenderer, mAsset->get("balloon4.png")); - mTextureBullet = new LTexture(mRenderer, mAsset->get("bullet.png")); - mTextureGameBG = new LTexture(mRenderer, mAsset->get("game_bg.png")); - mTextureGameText = new LTexture(mRenderer, mAsset->get("game_text.png")); - mTextureItems = new LTexture(mRenderer, mAsset->get("items.png")); + balloon1Texture = new LTexture(renderer, asset->get("balloon1.png")); + balloon2Texture = new LTexture(renderer, asset->get("balloon2.png")); + balloon3Texture = new LTexture(renderer, asset->get("balloon3.png")); + balloon4Texture = new LTexture(renderer, asset->get("balloon4.png")); + bulletTexture = new LTexture(renderer, asset->get("bullet.png")); + + gameBuildingsTexture = new LTexture(renderer, asset->get("game_buildings.png")); + gameCloudsTexture = new LTexture(renderer, asset->get("game_clouds.png")); + gameGrassTexture = new LTexture(renderer, asset->get("game_grass.png")); + gamePowerMeterTexture = new LTexture(renderer, asset->get("game_power_meter.png")); + gameSkyColorsTexture = new LTexture(renderer, asset->get("game_sky_colors.png")); + gameTextTexture = new LTexture(renderer, asset->get("game_text.png")); + itemTexture = new LTexture(renderer, asset->get("items.png")); balloon1Animation = new std::vector; balloon2Animation = new std::vector; balloon3Animation = new std::vector; balloon4Animation = new std::vector; - loadAnimations(mAsset->get("balloon1.ani"), balloon1Animation); - loadAnimations(mAsset->get("balloon2.ani"), balloon2Animation); - loadAnimations(mAsset->get("balloon3.ani"), balloon3Animation); - loadAnimations(mAsset->get("balloon4.ani"), balloon4Animation); + loadAnimations(asset->get("balloon1.ani"), balloon1Animation); + loadAnimations(asset->get("balloon2.ani"), balloon2Animation); + loadAnimations(asset->get("balloon3.ani"), balloon3Animation); + loadAnimations(asset->get("balloon4.ani"), balloon4Animation); - mText = new Text(mAsset->get("smb2.png"), mAsset->get("smb2.txt"), mRenderer); - mTextScoreBoard = new Text(mAsset->get("8bithud.png"), mAsset->get("8bithud.txt"), mRenderer); - mTextBig = new Text(mAsset->get("smb2_big.png"), mAsset->get("smb2_big.txt"), mRenderer); - mTextNokia2 = new Text(mAsset->get("nokia2.png"), mAsset->get("nokia2.txt"), mRenderer); - mTextNokiaBig2 = new Text(mAsset->get("nokia_big2.png"), mAsset->get("nokia_big2.txt"), mRenderer); + text = new Text(asset->get("smb2.png"), asset->get("smb2.txt"), renderer); + textScoreBoard = new Text(asset->get("8bithud.png"), asset->get("8bithud.txt"), renderer); + textBig = new Text(asset->get("smb2_big.png"), asset->get("smb2_big.txt"), renderer); + textNokia2 = new Text(asset->get("nokia2.png"), asset->get("nokia2.txt"), renderer); + textNokiaBig2 = new Text(asset->get("nokia_big2.png"), asset->get("nokia_big2.txt"), renderer); - mMenuGameOver = new Menu(mRenderer, mAsset, mInput, mAsset->get("gameover.men")); - mMenuPause = new Menu(mRenderer, mAsset, mInput, mAsset->get("pause.men")); + gameOverMenu = new Menu(renderer, asset, input, asset->get("gameover.men")); + pauseMenu = new Menu(renderer, asset, input, asset->get("pause.men")); - mFade = new Fade(mRenderer); - mEventHandler = new SDL_Event(); + fade = new Fade(renderer); + eventHandler = new SDL_Event(); - mClouds1a = new MovingSprite(0, 0, 256, 52, -0.4f, 0.0f, 0.0f, 0.0f, mTextureGameBG, mRenderer); - mClouds1b = new MovingSprite(256, 0, 256, 52, -0.4f, 0.0f, 0.0f, 0.0f, mTextureGameBG, mRenderer); - mClouds2a = new MovingSprite(0, 52, 256, 32, -0.2f, 0.0f, 0.0f, 0.0f, mTextureGameBG, mRenderer); - mClouds2b = new MovingSprite(256, 52, 256, 32, -0.2f, 0.0f, 0.0f, 0.0f, mTextureGameBG, mRenderer); + clouds1A = new MovingSprite(0, 0, 256, 52, -0.4f, 0.0f, 0.0f, 0.0f, gameCloudsTexture, renderer); + clouds1B = new MovingSprite(256, 0, 256, 52, -0.4f, 0.0f, 0.0f, 0.0f, gameCloudsTexture, renderer); + clouds2A = new MovingSprite(0, 52, 256, 32, -0.2f, 0.0f, 0.0f, 0.0f, gameCloudsTexture, renderer); + clouds2B = new MovingSprite(256, 52, 256, 32, -0.2f, 0.0f, 0.0f, 0.0f, gameCloudsTexture, renderer); - m1000Bitmap = new SmartSprite(mTextureGameText, mRenderer); - m2500Bitmap = new SmartSprite(mTextureGameText, mRenderer); - m5000Bitmap = new SmartSprite(mTextureGameText, mRenderer); + n1000Sprite = new SmartSprite(gameTextTexture, renderer); + n2500Sprite = new SmartSprite(gameTextTexture, renderer); + n5000Sprite = new SmartSprite(gameTextTexture, renderer); - mSpriteBackground = new Sprite(0, 0, GAME_WIDTH, GAME_HEIGHT, mTextureGameBG, mRenderer); - mSpriteGetReady = new Sprite(0, PLAY_AREA_CENTER_Y - 10, 109, 20, mTextureGameText, mRenderer); - mSpriteGradient = new Sprite(0, 0, GAME_WIDTH, GAME_HEIGHT, mTextureGameBG, mRenderer); - mSpriteGrass = new Sprite(0, 85, GAME_WIDTH, 6, mTextureGameBG, mRenderer); - mSpritePowerMeter = new Sprite(PLAY_AREA_CENTER_X - 20, 170, 40, 8, mTextureGameBG, mRenderer); - mSpriteScoreBoard = new Sprite(0, 160, GAME_WIDTH, 32, mTextureGameBG, mRenderer); + buildingsSprite = new Sprite(0, 0, 256, 160, gameBuildingsTexture, renderer); + + skyColorsSprite = new Sprite(0, 0, GAME_WIDTH, GAME_HEIGHT, gameSkyColorsTexture, renderer); + grassSprite = new Sprite(0, 0, 256, 6, gameGrassTexture, renderer); + powerMeterSprite = new Sprite(PLAY_AREA_CENTER_X - 20, 170, 40, 7, gamePowerMeterTexture, renderer); // Inicializa las variables necesarias para la sección 'Game' init(); @@ -102,58 +106,69 @@ Game::~Game() delete balloon3Animation; delete balloon4Animation; - mTextureBullet->unload(); - delete mTextureBullet; + bulletTexture->unload(); + delete bulletTexture; - mTextureGameBG->unload(); - delete mTextureGameBG; + gameBuildingsTexture->unload(); + delete gameBuildingsTexture; - mTextureGameText->unload(); - delete mTextureGameText; + gameCloudsTexture->unload(); + delete gameCloudsTexture; - mTextureItems->unload(); - delete mTextureItems; + gameGrassTexture->unload(); + delete gameGrassTexture; - delete mText; - delete mTextBig; - delete mTextScoreBoard; - delete mTextNokia2; - delete mTextNokiaBig2; - delete mMenuGameOver; - delete mMenuPause; - delete mFade; - delete mEventHandler; - delete mClouds1a; - delete mClouds1b; - delete mClouds2a; - delete mClouds2b; - delete m1000Bitmap; - delete m2500Bitmap; - delete m5000Bitmap; - delete mSpriteBackground; - delete mSpriteGetReady; - delete mSpriteGradient; - delete mSpriteGrass; - delete mSpritePowerMeter; - delete mSpriteScoreBoard; + gamePowerMeterTexture->unload(); + delete gamePowerMeterTexture; - JA_DeleteSound(mSoundBalloon); - JA_DeleteSound(mSoundBullet); - JA_DeleteSound(mSoundPlayerCollision); - JA_DeleteSound(mSoundHiScore); - JA_DeleteSound(mSoundItemDrop); - JA_DeleteSound(mSoundItemPickup); - JA_DeleteSound(mSoundCoffeeOut); - JA_DeleteSound(mSoundStageChange); - JA_DeleteSound(mSoundBubble1); - JA_DeleteSound(mSoundBubble2); - JA_DeleteSound(mSoundBubble3); - JA_DeleteSound(mSoundBubble4); - JA_DeleteSound(mSoundClock); - JA_DeleteSound(mSoundPowerBall); - JA_DeleteSound(mSoundCollision); + gameSkyColorsTexture->unload(); + delete gameSkyColorsTexture; - JA_DeleteMusic(mMusicPlaying); + gameTextTexture->unload(); + delete gameTextTexture; + + itemTexture->unload(); + delete itemTexture; + + delete text; + delete textBig; + delete textScoreBoard; + delete textNokia2; + delete textNokiaBig2; + delete gameOverMenu; + delete pauseMenu; + delete fade; + delete eventHandler; + delete clouds1A; + delete clouds1B; + delete clouds2A; + delete clouds2B; + delete n1000Sprite; + delete n2500Sprite; + delete n5000Sprite; + delete buildingsSprite; + + delete skyColorsSprite; + delete grassSprite; + delete powerMeterSprite; + + JA_DeleteSound(balloonSound); + JA_DeleteSound(bulletSound); + JA_DeleteSound(playerCollisionSound); + JA_DeleteSound(hiScoreSound); + JA_DeleteSound(itemDropSound); + JA_DeleteSound(itemPickUpSound); + JA_DeleteSound(coffeeOutSound); + JA_DeleteSound(stageChangeSound); + JA_DeleteSound(bubble1Sound); + JA_DeleteSound(bubble2Sound); + JA_DeleteSound(bubble3Sound); + JA_DeleteSound(bubble4Sound); + JA_DeleteSound(clockSound); + JA_DeleteSound(powerBallSound); + JA_DeleteSound(coffeeMachineSound); + + JA_DeleteMusic(gameMusic); } // Inicializa el vector con los valores del seno @@ -188,14 +203,14 @@ void Game::init() if (mNumPlayers == 1) { - Player *player = new Player(mRenderer, mAsset, PLAY_AREA_CENTER_X - 11, PLAY_AREA_BOTTOM - 24); + Player *player = new Player(renderer, asset, PLAY_AREA_CENTER_X - 11, PLAY_AREA_BOTTOM - 24); players.push_back(player); } else if (mNumPlayers == 2) { - Player *player1 = new Player(mRenderer, mAsset, (PLAY_AREA_CENTER_FIRST_QUARTER_X * ((0 * 2) + 1)) - 11, PLAY_AREA_BOTTOM - 24); - Player *player2 = new Player(mRenderer, mAsset, (PLAY_AREA_CENTER_FIRST_QUARTER_X * ((1 * 2) + 1)) - 11, PLAY_AREA_BOTTOM - 24); + Player *player1 = new Player(renderer, asset, (PLAY_AREA_CENTER_FIRST_QUARTER_X * ((0 * 2) + 1)) - 11, PLAY_AREA_BOTTOM - 24); + Player *player2 = new Player(renderer, asset, (PLAY_AREA_CENTER_FIRST_QUARTER_X * ((1 * 2) + 1)) - 11, PLAY_AREA_BOTTOM - 24); players.push_back(player1); players.push_back(player2); } @@ -282,84 +297,75 @@ void Game::init() mBalloonsPopped += mStage[i].powerToComplete; } - // Modo debug - mDebug.enabled = false; - mDebug.enemySet = 0; - mDebug.gradR = mDebug.gradG = mDebug.gradB = 0; - // Modo demo mDemo.recording = false; mDemo.counter = 0; // Inicializa el objeto para el fundido - mFade->init(0x27, 0x27, 0x36); + fade->init(0x27, 0x27, 0x36); // Sprites - mClouds1a->setSpriteClip(256, 0, 256, 52); - mClouds1b->setSpriteClip(256, 0, 256, 52); - mClouds2a->setSpriteClip(256, 52, 256, 32); - mClouds2b->setSpriteClip(256, 52, 256, 32); + clouds1A->setSpriteClip(0, 0, 256, 52); + clouds1B->setSpriteClip(0, 0, 256, 52); + clouds2A->setSpriteClip(0, 52, 256, 32); + clouds2B->setSpriteClip(0, 52, 256, 32); - mSpriteGrass->setPosY(154); - mSpriteScoreBoard->setSpriteClip(0, 160, 256, 32); - mSpritePowerMeter->setSpriteClip(256, 192 - 8, 40, 8); + grassSprite->setPosY(154); + powerMeterSprite->setSpriteClip(0, 0, 40, 7); // Con los globos creados, calcula el nivel de amenaza evaluateAndSetMenace(); - // Inicializa el bitmap de GetReady! - mSpriteGetReady->setSpriteClip(0, 0, 109, 20); - // Inicializa el bitmap de 1000 puntos - m1000Bitmap->setPosX(0); - m1000Bitmap->setPosY(0); - m1000Bitmap->setWidth(26); - m1000Bitmap->setHeight(9); - m1000Bitmap->setVelX(0.0f); - m1000Bitmap->setVelY(-0.5f); - m1000Bitmap->setAccelX(0.0f); - m1000Bitmap->setAccelY(-0.1f); - m1000Bitmap->setSpriteClip(0, 20, 26, 9); - m1000Bitmap->setEnabled(false); - m1000Bitmap->setEnabledCounter(0); - m1000Bitmap->setDestX(0); - m1000Bitmap->setDestY(0); + n1000Sprite->setPosX(0); + n1000Sprite->setPosY(0); + n1000Sprite->setWidth(26); + n1000Sprite->setHeight(9); + n1000Sprite->setVelX(0.0f); + n1000Sprite->setVelY(-0.5f); + n1000Sprite->setAccelX(0.0f); + n1000Sprite->setAccelY(-0.1f); + n1000Sprite->setSpriteClip(0, 0, 26, 9); + n1000Sprite->setEnabled(false); + n1000Sprite->setEnabledCounter(0); + n1000Sprite->setDestX(0); + n1000Sprite->setDestY(0); // Inicializa el bitmap de 2500 puntos - m2500Bitmap->setPosX(0); - m2500Bitmap->setPosY(0); - m2500Bitmap->setWidth(28); - m2500Bitmap->setHeight(9); - m2500Bitmap->setVelX(0.0f); - m2500Bitmap->setVelY(-0.5f); - m2500Bitmap->setAccelX(0.0f); - m2500Bitmap->setAccelY(-0.1f); - m2500Bitmap->setSpriteClip(26, 20, 28, 9); - m2500Bitmap->setEnabled(false); - m2500Bitmap->setEnabledCounter(0); - m2500Bitmap->setDestX(0); - m2500Bitmap->setDestY(0); + n2500Sprite->setPosX(0); + n2500Sprite->setPosY(0); + n2500Sprite->setWidth(28); + n2500Sprite->setHeight(9); + n2500Sprite->setVelX(0.0f); + n2500Sprite->setVelY(-0.5f); + n2500Sprite->setAccelX(0.0f); + n2500Sprite->setAccelY(-0.1f); + n2500Sprite->setSpriteClip(26, 0, 28, 9); + n2500Sprite->setEnabled(false); + n2500Sprite->setEnabledCounter(0); + n2500Sprite->setDestX(0); + n2500Sprite->setDestY(0); // Inicializa el bitmap de 5000 puntos - m5000Bitmap->setPosX(0); - m5000Bitmap->setPosY(0); - m5000Bitmap->setWidth(28); - m5000Bitmap->setHeight(9); - m5000Bitmap->setVelX(0.0f); - m5000Bitmap->setVelY(-0.5f); - m5000Bitmap->setAccelX(0.0f); - m5000Bitmap->setAccelY(-0.1f); - m5000Bitmap->setSpriteClip(54, 20, 28, 9); - m5000Bitmap->setEnabled(false); - m5000Bitmap->setEnabledCounter(0); - m5000Bitmap->setDestX(0); - m5000Bitmap->setDestY(0); + n5000Sprite->setPosX(0); + n5000Sprite->setPosY(0); + n5000Sprite->setWidth(28); + n5000Sprite->setHeight(9); + n5000Sprite->setVelX(0.0f); + n5000Sprite->setVelY(-0.5f); + n5000Sprite->setAccelX(0.0f); + n5000Sprite->setAccelY(-0.1f); + n5000Sprite->setSpriteClip(54, 0, 28, 9); + n5000Sprite->setEnabled(false); + n5000Sprite->setEnabledCounter(0); + n5000Sprite->setDestX(0); + n5000Sprite->setDestY(0); // Los fondos - mGradientRect[0] = {0, 192, GAME_WIDTH, GAME_HEIGHT}; - mGradientRect[1] = {256, 192, GAME_WIDTH, GAME_HEIGHT}; - mGradientRect[2] = {0, 384, GAME_WIDTH, GAME_HEIGHT}; - mGradientRect[3] = {256, 384, GAME_WIDTH, GAME_HEIGHT}; + skyColorsRect[0] = {0, 0, GAME_WIDTH, GAME_HEIGHT}; + skyColorsRect[1] = {256, 0, GAME_WIDTH, GAME_HEIGHT}; + skyColorsRect[2] = {0, 192, GAME_WIDTH, GAME_HEIGHT}; + skyColorsRect[3] = {256, 192, GAME_WIDTH, GAME_HEIGHT}; } // Carga los recursos necesarios para la sección 'Game' @@ -368,24 +374,24 @@ bool Game::loadMedia() bool success = true; // Sonidos - mSoundBalloon = JA_LoadSound(mAsset->get("balloon.wav").c_str()); - mSoundBubble1 = JA_LoadSound(mAsset->get("bubble1.wav").c_str()); - mSoundBubble2 = JA_LoadSound(mAsset->get("bubble2.wav").c_str()); - mSoundBubble3 = JA_LoadSound(mAsset->get("bubble3.wav").c_str()); - mSoundBubble4 = JA_LoadSound(mAsset->get("bubble4.wav").c_str()); - mSoundBullet = JA_LoadSound(mAsset->get("bullet.wav").c_str()); - mSoundClock = JA_LoadSound(mAsset->get("clock.wav").c_str()); - mSoundCoffeeOut = JA_LoadSound(mAsset->get("coffeeout.wav").c_str()); - mSoundHiScore = JA_LoadSound(mAsset->get("hiscore.wav").c_str()); - mSoundItemDrop = JA_LoadSound(mAsset->get("itemdrop.wav").c_str()); - mSoundItemPickup = JA_LoadSound(mAsset->get("itempickup.wav").c_str()); - mSoundPlayerCollision = JA_LoadSound(mAsset->get("player_collision.wav").c_str()); - mSoundPowerBall = JA_LoadSound(mAsset->get("powerball.wav").c_str()); - mSoundStageChange = JA_LoadSound(mAsset->get("stage_change.wav").c_str()); - mSoundCollision = JA_LoadSound(mAsset->get("title.wav").c_str()); + balloonSound = JA_LoadSound(asset->get("balloon.wav").c_str()); + bubble1Sound = JA_LoadSound(asset->get("bubble1.wav").c_str()); + bubble2Sound = JA_LoadSound(asset->get("bubble2.wav").c_str()); + bubble3Sound = JA_LoadSound(asset->get("bubble3.wav").c_str()); + bubble4Sound = JA_LoadSound(asset->get("bubble4.wav").c_str()); + bulletSound = JA_LoadSound(asset->get("bullet.wav").c_str()); + clockSound = JA_LoadSound(asset->get("clock.wav").c_str()); + coffeeOutSound = JA_LoadSound(asset->get("coffeeout.wav").c_str()); + hiScoreSound = JA_LoadSound(asset->get("hiscore.wav").c_str()); + itemDropSound = JA_LoadSound(asset->get("itemdrop.wav").c_str()); + itemPickUpSound = JA_LoadSound(asset->get("itempickup.wav").c_str()); + playerCollisionSound = JA_LoadSound(asset->get("player_collision.wav").c_str()); + powerBallSound = JA_LoadSound(asset->get("powerball.wav").c_str()); + stageChangeSound = JA_LoadSound(asset->get("stage_change.wav").c_str()); + coffeeMachineSound = JA_LoadSound(asset->get("title.wav").c_str()); // Musicas - mMusicPlaying = JA_LoadMusic(mAsset->get("playing.ogg").c_str()); + gameMusic = JA_LoadMusic(asset->get("playing.ogg").c_str()); return success; } @@ -395,7 +401,7 @@ bool Game::loadScoreFile() { // Indicador de éxito en la carga bool success = true; - const std::string p = mAsset->get("score.bin"); + const std::string p = asset->get("score.bin"); const std::string filename = p.substr(p.find_last_of("\\/") + 1); SDL_RWops *file = SDL_RWFromFile(p.c_str(), "r+b"); @@ -461,7 +467,7 @@ bool Game::loadDemoFile() { // Indicador de éxito en la carga bool success = true; - const std::string p = mAsset->get("demo.bin"); + const std::string p = asset->get("demo.bin"); const std::string filename = p.substr(p.find_last_of("\\/") + 1); SDL_RWops *file = SDL_RWFromFile(p.c_str(), "r+b"); @@ -517,7 +523,7 @@ bool Game::loadDemoFile() bool Game::saveScoreFile() { bool success = true; - const std::string p = mAsset->get("score.bin"); + const std::string p = asset->get("score.bin"); const std::string filename = p.substr(p.find_last_of("\\/") + 1); SDL_RWops *file = SDL_RWFromFile(p.c_str(), "w+b"); if (file != nullptr) @@ -544,7 +550,7 @@ bool Game::saveScoreFile() bool Game::saveDemoFile() { bool success = true; - const std::string p = mAsset->get("demo.bin"); + const std::string p = asset->get("demo.bin"); const std::string filename = p.substr(p.find_last_of("\\/") + 1); if (mDemo.recording) { @@ -1312,9 +1318,6 @@ void Game::deployEnemyFormation() mLastEnemyDeploy = set; - if (mDebug.enabled) - set = mDebug.enemySet; - const Uint8 numEnemies = mStage[mCurrentStage].enemyPool->set[set]->numberOfEnemies; for (int i = 0; i < numEnemies; ++i) { @@ -1362,7 +1365,7 @@ void Game::updateHiScore() if (mHiScoreAchieved == false) { mHiScoreAchieved = true; - JA_PlaySound(mSoundHiScore); + JA_PlaySound(hiScoreSound); } } } @@ -1413,8 +1416,14 @@ std::string Game::updateScoreText(Uint32 num) // Pinta el marcador en pantalla usando un objeto texto void Game::renderScoreBoard() { - mSpriteScoreBoard->render(); + // Dibuja el fondo del marcador + SDL_SetRenderDrawColor(renderer, 46, 63, 71, 255); + SDL_Rect rect = {0, 160, 256, 32}; + SDL_RenderFillRect(renderer, &rect); + SDL_SetRenderDrawColor(renderer, 13, 26, 43, 255); + SDL_RenderDrawLine(renderer, 0, 160, 255, 160); + // Anclas para los elementos const int offset1 = 162; const int offset2 = offset1 + 7; const int offset3 = offset2 + 7; @@ -1424,55 +1433,54 @@ void Game::renderScoreBoard() const int offsetRight = PLAY_AREA_RIGHT - 45; // PLAYER1 - SCORE - mTextScoreBoard->writeCentered(offsetLeft, offset1, mLang->getText(53)); - mTextScoreBoard->writeCentered(offsetLeft, offset2, updateScoreText(players.at(0)->getScore())); + textScoreBoard->writeCentered(offsetLeft, offset1, lang->getText(53)); + textScoreBoard->writeCentered(offsetLeft, offset2, updateScoreText(players.at(0)->getScore())); // PLAYER1 - MULT - mTextScoreBoard->writeCentered(offsetLeft, offset3, mLang->getText(55)); - mTextScoreBoard->writeCentered(offsetLeft, offset4, std::to_string(players.at(0)->getScoreMultiplier()).substr(0, 3)); + textScoreBoard->writeCentered(offsetLeft, offset3, lang->getText(55)); + textScoreBoard->writeCentered(offsetLeft, offset4, std::to_string(players.at(0)->getScoreMultiplier()).substr(0, 3)); if (mNumPlayers == 2) { // PLAYER2 - SCORE - mTextScoreBoard->writeCentered(offsetRight, offset1, mLang->getText(54)); - mTextScoreBoard->writeCentered(offsetRight, offset2, updateScoreText(players.at(1)->getScore())); + textScoreBoard->writeCentered(offsetRight, offset1, lang->getText(54)); + textScoreBoard->writeCentered(offsetRight, offset2, updateScoreText(players.at(1)->getScore())); // PLAYER2 - MULT - mTextScoreBoard->writeCentered(offsetRight, offset3, mLang->getText(55)); - mTextScoreBoard->writeCentered(offsetRight, offset4, std::to_string(players.at(1)->getScoreMultiplier()).substr(0, 3)); + textScoreBoard->writeCentered(offsetRight, offset3, lang->getText(55)); + textScoreBoard->writeCentered(offsetRight, offset4, std::to_string(players.at(1)->getScoreMultiplier()).substr(0, 3)); } else { // PLAYER2 - SCORE - mTextScoreBoard->writeCentered(offsetRight, offset1, mLang->getText(54)); - mTextScoreBoard->writeCentered(offsetRight, offset2, "0000000"); + textScoreBoard->writeCentered(offsetRight, offset1, lang->getText(54)); + textScoreBoard->writeCentered(offsetRight, offset2, "0000000"); // PLAYER2 - MULT - mTextScoreBoard->writeCentered(offsetRight, offset3, mLang->getText(55)); - mTextScoreBoard->writeCentered(offsetRight, offset4, "1.0"); + textScoreBoard->writeCentered(offsetRight, offset3, lang->getText(55)); + textScoreBoard->writeCentered(offsetRight, offset4, "1.0"); } // STAGE - mTextScoreBoard->writeCentered(PLAY_AREA_CENTER_X, offset1, mLang->getText(57) + std::to_string(mStage[mCurrentStage].number)); + textScoreBoard->writeCentered(PLAY_AREA_CENTER_X, offset1, lang->getText(57) + std::to_string(mStage[mCurrentStage].number)); - // POWER - mSpritePowerMeter->setPosY(offset2); - mSpritePowerMeter->setSpriteClip(256, 184, 40, 8); - mSpritePowerMeter->render(); + // POWERMETER + powerMeterSprite->setPosY(offset2); + powerMeterSprite->setSpriteClip(0, 0, 40, 7); + powerMeterSprite->render(); const float percent = (mStage[mCurrentStage].currentPower * 40.0f) / mStage[mCurrentStage].powerToComplete; - mSpritePowerMeter->setSpriteClip(296, 184, (int)percent, 8); - mSpritePowerMeter->render(); + powerMeterSprite->setSpriteClip(0, 0, (int)percent, 7); + powerMeterSprite->render(); // HI-SCORE - mTextScoreBoard->writeCentered(PLAY_AREA_CENTER_X, offset3, mLang->getText(56)); - mTextScoreBoard->writeCentered(PLAY_AREA_CENTER_X, offset4, updateScoreText(mHiScore)); + textScoreBoard->writeCentered(PLAY_AREA_CENTER_X, offset3, lang->getText(56)); + textScoreBoard->writeCentered(PLAY_AREA_CENTER_X, offset4, updateScoreText(mHiScore)); } // Actualiza las variables del jugador -void Game::updatePlayer() +void Game::updatePlayers() { for (auto player : players) - // for (int i = 0; i < mNumPlayers; i++) { player->update(); @@ -1497,6 +1505,15 @@ void Game::updatePlayer() } } +// Dibuja a los jugadores +void Game::renderPlayers() +{ + for (auto player : players) + { + player->render(); + } +} + // Actualiza las variables de la fase void Game::updateStage() { @@ -1524,7 +1541,7 @@ void Game::updateStage() updateHiScore(); JA_StopMusic(); } - JA_PlaySound(mSoundStageChange); + JA_PlaySound(stageChangeSound); mStageBitmapCounter = 0; mEnemySpeed = mDefaultEnemySpeed; setBalloonSpeed(mEnemySpeed); @@ -1611,16 +1628,16 @@ void Game::updateDeath() switch (sound) { case 0: - JA_PlaySound(mSoundBubble1, 0); + JA_PlaySound(bubble1Sound, 0); break; case 1: - JA_PlaySound(mSoundBubble2, 0); + JA_PlaySound(bubble2Sound, 0); break; case 2: - JA_PlaySound(mSoundBubble3, 0); + JA_PlaySound(bubble3Sound, 0); break; case 3: - JA_PlaySound(mSoundBubble4, 0); + JA_PlaySound(bubble4Sound, 0); break; default: @@ -1639,7 +1656,7 @@ void Game::updateDeath() void Game::renderDeathFade(int counter) // Counter debe ir de 0 a 150 { - SDL_SetRenderDrawColor(mRenderer, 0x27, 0x27, 0x36, 255); + SDL_SetRenderDrawColor(renderer, 0x27, 0x27, 0x36, 255); if (counter < 150) { @@ -1655,13 +1672,13 @@ void Game::renderDeathFade(int counter) rect[i].h = h; else rect[i].h = std::max(rect[i - 1].h - 3, 0); - SDL_RenderFillRect(mRenderer, &rect[i]); + SDL_RenderFillRect(renderer, &rect[i]); } } else { SDL_Rect rect = {0, 0, GAME_WIDTH, GAME_HEIGHT}; - SDL_RenderFillRect(mRenderer, &rect); + SDL_RenderFillRect(renderer, &rect); } } @@ -1686,7 +1703,7 @@ void Game::renderBalloons() // Crea un globo nuevo en el vector de globos Uint8 Game::createBalloon(float x, int y, Uint8 kind, float velx, float speed, Uint16 creationtimer) { - Balloon *b = new Balloon(x, y, kind, velx, speed, creationtimer, balloonTexture(kind), balloonStreamAnimation(kind), mRenderer); + Balloon *b = new Balloon(x, y, kind, velx, speed, creationtimer, balloonTexture(kind), balloonStreamAnimation(kind), renderer); balloons.push_back(b); return (Uint8)(balloons.size() - 1); } @@ -1700,11 +1717,11 @@ void Game::createPowerBall() const int center = PLAY_AREA_CENTER_X - (BALLOON_WIDTH_4 / 2); const int right = PLAY_AREA_RIGHT - BALLOON_WIDTH_4; - const int luck =rand() % 3; + const int luck = rand() % 3; const int x[3] = {left, center, right}; const float vx[3] = {BALLOON_VELX_POSITIVE, BALLOON_VELX_POSITIVE, BALLOON_VELX_NEGATIVE}; - Balloon *b = new Balloon(x[luck], posY, POWER_BALL, vx[luck], mEnemySpeed, 100, balloon4Texture, balloon4Animation, mRenderer); + Balloon *b = new Balloon(x[luck], posY, POWER_BALL, vx[luck], mEnemySpeed, 100, balloon4Texture, balloon4Animation, renderer); balloons.push_back(b); mPowerBallEnabled = true; @@ -1923,7 +1940,7 @@ void Game::popAllBalloons() } } - JA_PlaySound(mSoundBalloon); + JA_PlaySound(balloonSound); } // Destruye todos los globos @@ -1938,7 +1955,7 @@ void Game::destroyAllBalloons() } mEnemyDeployCounter = 255; - JA_PlaySound(mSoundPowerBall); + JA_PlaySound(powerBallSound); mEffect.flash = true; mEffect.shake = true; } @@ -2092,38 +2109,43 @@ void Game::checkPlayerItemCollision(Player *player) case ITEM_POINTS_1_DISK: player->addScore(1000); updateHiScore(); - createItemScoreSprite(item->getPosX() + (item->getWidth() / 2) - (m1000Bitmap->getWidth() / 2), player->getPosY(), m1000Bitmap); - JA_PlaySound(mSoundItemPickup); + createItemScoreSprite(item->getPosX() + (item->getWidth() / 2) - (n1000Sprite->getWidth() / 2), player->getPosY(), n1000Sprite); + JA_PlaySound(itemPickUpSound); break; + case ITEM_POINTS_2_GAVINA: player->addScore(2500); updateHiScore(); - createItemScoreSprite(item->getPosX() + (item->getWidth() / 2) - (m2500Bitmap->getWidth() / 2), player->getPosY(), m2500Bitmap); - JA_PlaySound(mSoundItemPickup); + createItemScoreSprite(item->getPosX() + (item->getWidth() / 2) - (n2500Sprite->getWidth() / 2), player->getPosY(), n2500Sprite); + JA_PlaySound(itemPickUpSound); break; + case ITEM_POINTS_3_PACMAR: player->addScore(5000); updateHiScore(); - createItemScoreSprite(item->getPosX() + (item->getWidth() / 2) - (m5000Bitmap->getWidth() / 2), player->getPosY(), m5000Bitmap); - JA_PlaySound(mSoundItemPickup); + createItemScoreSprite(item->getPosX() + (item->getWidth() / 2) - (n5000Sprite->getWidth() / 2), player->getPosY(), n5000Sprite); + JA_PlaySound(itemPickUpSound); break; + case ITEM_CLOCK: enableTimeStopItem(); - JA_PlaySound(mSoundItemPickup); + JA_PlaySound(itemPickUpSound); break; + case ITEM_COFFEE: if (player->getCoffees() == 2) { player->addScore(5000); updateHiScore(); - createItemScoreSprite(item->getPosX() + (item->getWidth() / 2) - (m5000Bitmap->getWidth() / 2), player->getPosY(), m5000Bitmap); + createItemScoreSprite(item->getPosX() + (item->getWidth() / 2) - (n5000Sprite->getWidth() / 2), player->getPosY(), n5000Sprite); } player->giveExtraHit(); - JA_PlaySound(mSoundItemPickup); + JA_PlaySound(itemPickUpSound); break; + case ITEM_COFFEE_MACHINE: player->setPowerUp(true); - JA_PlaySound(mSoundItemPickup); + JA_PlaySound(itemPickUpSound); mCoffeeMachineEnabled = false; break; @@ -2160,7 +2182,7 @@ void Game::checkBulletBalloonCollision() // Si no es el modo demo, genera un sonido if (!mDemo.enabled) { - JA_PlaySound(mSoundBalloon); + JA_PlaySound(balloonSound); } // Deshabilita la bala @@ -2173,7 +2195,7 @@ void Game::checkBulletBalloonCollision() if (droppeditem != ITEM_COFFEE_MACHINE) { createItem(droppeditem, balloon->getPosX(), balloon->getPosY()); - JA_PlaySound(mSoundItemDrop); + JA_PlaySound(itemDropSound); } else { @@ -2219,7 +2241,7 @@ void Game::renderBullets() // Crea un objeto bala void Game::createBullet(int x, int y, Uint8 kind, bool poweredUp, int owner) { - Bullet *b = new Bullet(x, y, kind, poweredUp, owner, mTextureBullet, mRenderer); + Bullet *b = new Bullet(x, y, kind, poweredUp, owner, bulletTexture, renderer); bullets.push_back(b); } @@ -2249,7 +2271,7 @@ void Game::updateItems() item->update(); if (item->isOnFloor()) { - JA_PlaySound(mSoundCollision); + JA_PlaySound(coffeeMachineSound); mEffect.shake = true; } } @@ -2344,7 +2366,7 @@ Uint8 Game::dropItem() // Crea un objeto item void Game::createItem(Uint8 type, float x, float y) { - Item *item = new Item(mRenderer, mAsset, type, x, y); + Item *item = new Item(renderer, asset, type, x, y); items.push_back(item); } @@ -2367,7 +2389,7 @@ void Game::freeItems() // Crea un objeto SmartSprite para mostrar la puntuación al coger un objeto void Game::createItemScoreSprite(int x, int y, SmartSprite *sprite) { - SmartSprite *ss = new SmartSprite(nullptr, mRenderer); + SmartSprite *ss = new SmartSprite(nullptr, renderer); smartSprites.push_back(ss); // Crea una copia del objeto @@ -2402,8 +2424,8 @@ void Game::renderFlashEffect() if (mEffect.flash) { // Pantallazo blanco - SDL_SetRenderDrawColor(mRenderer, 0xFF, 0xFF, 0xFF, 0xFF); - SDL_RenderClear(mRenderer); + SDL_SetRenderDrawColor(renderer, 0xFF, 0xFF, 0xFF, 0xFF); + SDL_RenderClear(renderer); mEffect.flash = false; } @@ -2429,7 +2451,7 @@ void Game::updateShakeEffect() // Crea un SmartSprite para arrojar el item café al recibir un impacto void Game::throwCoffee(int x, int y) { - SmartSprite *ss = new SmartSprite(mTextureItems, mRenderer); + SmartSprite *ss = new SmartSprite(itemTexture, renderer); smartSprites.push_back(ss); ss->setPosX(x - 8); @@ -2457,7 +2479,7 @@ void Game::throwPlayer(int x, int y, Player *player) // player->deathIndex = getSmartSpriteFreeIndex(); - SmartSprite *ss = new SmartSprite(nullptr, mRenderer); + SmartSprite *ss = new SmartSprite(nullptr, renderer); smartSprites.push_back(ss); ss->setTexture(player->getDeadTexture()); @@ -2503,16 +2525,16 @@ void Game::killPlayer(Player *player) { player->removeExtraHit(); throwCoffee(player->getPosX() + (player->getWidth() / 2), player->getPosY() + (player->getHeight() / 2)); - JA_PlaySound(mSoundCoffeeOut); + JA_PlaySound(coffeeOutSound); } else { JA_PauseMusic(); stopAllBalloons(10); - JA_PlaySound(mSoundPlayerCollision); + JA_PlaySound(playerCollisionSound); shakeScreen(); SDL_Delay(500); - JA_PlaySound(mSoundCoffeeOut); + JA_PlaySound(coffeeOutSound); throwPlayer(player->getPosX(), player->getPosY(), player); player->setAlive(false); if (allPlayersAreDead()) @@ -2615,7 +2637,7 @@ void Game::update() checkGameInput(); // Actualiza las variables del jugador - updatePlayer(); + updatePlayers(); // Actualiza el fondo updateBackground(); @@ -2672,40 +2694,40 @@ void Game::update() // Actualiza el fondo void Game::updateBackground() { - mClouds1a->move(); - mClouds1b->move(); - mClouds2a->move(); - mClouds2b->move(); + clouds1A->move(); + clouds1B->move(); + clouds2A->move(); + clouds2B->move(); - if (mClouds1a->getPosX() < -mClouds1a->getWidth()) + if (clouds1A->getPosX() < -clouds1A->getWidth()) { - mClouds1a->setPosX(mClouds1a->getWidth()); + clouds1A->setPosX(clouds1A->getWidth()); } - if (mClouds1b->getPosX() < -mClouds1b->getWidth()) + if (clouds1B->getPosX() < -clouds1B->getWidth()) { - mClouds1b->setPosX(mClouds1b->getWidth()); + clouds1B->setPosX(clouds1B->getWidth()); } - if (mClouds2a->getPosX() < -mClouds2a->getWidth()) + if (clouds2A->getPosX() < -clouds2A->getWidth()) { - mClouds2a->setPosX(mClouds2a->getWidth()); + clouds2A->setPosX(clouds2A->getWidth()); } - if (mClouds2b->getPosX() < -mClouds2b->getWidth()) + if (clouds2B->getPosX() < -clouds2B->getWidth()) { - mClouds2b->setPosX(mClouds2b->getWidth()); + clouds2B->setPosX(clouds2B->getWidth()); } - mSpriteGrass->setSpriteClip(256, 85 + (6 * (mCounter / 20 % 2)), GAME_WIDTH, 6); + grassSprite->setSpriteClip(0, (6 * (mCounter / 20 % 2)), 256, 6); if (mEffect.shake) { - mSpriteBackground->setPosX(((mEffect.shakeCounter % 2) * 2) - 1); + buildingsSprite->setPosX(((mEffect.shakeCounter % 2) * 2) - 1); } else { - mSpriteBackground->setPosX(0); + buildingsSprite->setPosX(0); } } @@ -2717,33 +2739,36 @@ void Game::renderBackground() const int alpha = std::max((255 - (int)(255 * percent)), 0); // Dibuja el gradiente 2 - mSpriteGradient->setSpriteClip(mGradientRect[((int)gradientNumber + 1) % 4]); - mSpriteGradient->render(); + skyColorsSprite->setSpriteClip(skyColorsRect[((int)gradientNumber + 1) % 4]); + gameSkyColorsTexture->setAlpha(255); + skyColorsSprite->render(); // Dibuja el gradiente 1 con una opacidad cada vez menor - mSpriteGradient->setSpriteClip(mGradientRect[(int)gradientNumber]); - mTextureGameBG->setAlpha(alpha); - mSpriteGradient->render(); - mTextureGameBG->setAlpha(255); + skyColorsSprite->setSpriteClip(skyColorsRect[(int)gradientNumber]); + gameSkyColorsTexture->setAlpha(alpha); + skyColorsSprite->render(); - mClouds1a->render(); - mClouds1b->render(); - mClouds2a->render(); - mClouds2b->render(); + // Dibuja las nubes + clouds1A->render(); + clouds1B->render(); + clouds2A->render(); + clouds2B->render(); - mSpriteBackground->render(); + // Dinuja los edificios + buildingsSprite->render(); - mSpriteGrass->render(); + // Dibuja la hierba + grassSprite->render(); } // Dibuja el juego void Game::render() { // Prepara para empezar a dibujar en la textura de juego - mScreen->start(); + screen->start(); // Limpia la pantalla - mScreen->clean(bgColor); + screen->clean(bgColor); // Dibuja los objetos renderBackground(); @@ -2753,11 +2778,7 @@ void Game::render() renderItems(); renderSmartSprites(); renderScoreBoard(); - - for (auto player : players) - { - player->render(); - } + renderPlayers(); if ((mDeathCounter <= 150) && !players.at(0)->isAlive()) { @@ -2771,11 +2792,8 @@ void Game::render() renderFlashEffect(); - // Pinta la informacion de debug - renderDebugInfo(); - // Vuelca el contenido del renderizador en pantalla - mScreen->blit(); + screen->blit(); } // Gestiona el nivel de amenaza @@ -2857,7 +2875,7 @@ void Game::checkGameInput() } // Comprueba el input de pausa - if (mInput->checkInput(INPUT_BUTTON_PAUSE, REPEAT_FALSE)) + if (input->checkInput(INPUT_BUTTON_PAUSE, REPEAT_FALSE)) { mSection.name = PROG_SECTION_TITLE; } @@ -2881,7 +2899,7 @@ void Game::checkGameInput() if (player->isAlive()) { // Input a la izquierda - if (mInput->checkInput(INPUT_LEFT, REPEAT_TRUE, mOptions->input[i].deviceType, mOptions->input[i].id)) + if (input->checkInput(INPUT_LEFT, REPEAT_TRUE, mOptions->input[i].deviceType, mOptions->input[i].id)) { player->setInput(INPUT_LEFT); mDemo.keys.left = 1; @@ -2889,7 +2907,7 @@ void Game::checkGameInput() else { // Input a la derecha - if (mInput->checkInput(INPUT_RIGHT, REPEAT_TRUE, mOptions->input[i].deviceType, mOptions->input[i].id)) + if (input->checkInput(INPUT_RIGHT, REPEAT_TRUE, mOptions->input[i].deviceType, mOptions->input[i].id)) { player->setInput(INPUT_RIGHT); mDemo.keys.right = 1; @@ -2902,7 +2920,7 @@ void Game::checkGameInput() } } // Comprueba el input de disparar al centro - if (mInput->checkInput(INPUT_BUTTON_2, REPEAT_TRUE, mOptions->input[i].deviceType, mOptions->input[i].id)) + if (input->checkInput(INPUT_BUTTON_2, REPEAT_TRUE, mOptions->input[i].deviceType, mOptions->input[i].id)) { if (player->canFire()) { @@ -2911,14 +2929,14 @@ void Game::checkGameInput() player->setFireCooldown(10); // Reproduce el sonido de disparo - JA_PlaySound(mSoundBullet); + JA_PlaySound(bulletSound); mDemo.keys.fire = 1; } } // Comprueba el input de disparar a la izquierda - if (mInput->checkInput(INPUT_BUTTON_1, REPEAT_TRUE, mOptions->input[i].deviceType, mOptions->input[i].id)) + if (input->checkInput(INPUT_BUTTON_1, REPEAT_TRUE, mOptions->input[i].deviceType, mOptions->input[i].id)) { if (player->canFire()) { @@ -2927,14 +2945,14 @@ void Game::checkGameInput() player->setFireCooldown(10); // Reproduce el sonido de disparo - JA_PlaySound(mSoundBullet); + JA_PlaySound(bulletSound); mDemo.keys.fireLeft = 1; } } // Comprueba el input de disparar a la derecha - if (mInput->checkInput(INPUT_BUTTON_3, REPEAT_TRUE, mOptions->input[i].deviceType, mOptions->input[i].id)) + if (input->checkInput(INPUT_BUTTON_3, REPEAT_TRUE, mOptions->input[i].deviceType, mOptions->input[i].id)) { if (player->canFire()) { @@ -2943,14 +2961,14 @@ void Game::checkGameInput() player->setFireCooldown(10); // Reproduce el sonido de disparo - JA_PlaySound(mSoundBullet); + JA_PlaySound(bulletSound); mDemo.keys.fireRight = 1; } } // Comprueba el input de pausa - if (mInput->checkInput(INPUT_CANCEL, REPEAT_FALSE, mOptions->input[i].deviceType, mOptions->input[i].id)) + if (input->checkInput(INPUT_CANCEL, REPEAT_FALSE, mOptions->input[i].deviceType, mOptions->input[i].id)) { mSection.subsection = GAME_SECTION_PAUSE; @@ -2985,8 +3003,7 @@ void Game::renderMessages() // GetReady if ((mCounter < STAGE_COUNTER) && (!mDemo.enabled)) { - mSpriteGetReady->setPosX((int)mGetReadyBitmapPath[mCounter]); - mTextNokiaBig2->write((int)mGetReadyBitmapPath[mCounter], PLAY_AREA_CENTER_Y - 8, mLang->getText(75), -2); + textNokiaBig2->write((int)mGetReadyBitmapPath[mCounter], PLAY_AREA_CENTER_Y - 8, lang->getText(75), -2); } // Time Stopped @@ -2994,21 +3011,21 @@ void Game::renderMessages() { if ((mTimeStoppedCounter > 100) || (mTimeStoppedCounter % 10 > 4)) { - mTextNokia2->writeDX(TXT_CENTER, PLAY_AREA_CENTER_X, PLAY_AREA_FIRST_QUARTER_Y, mLang->getText(36) + std::to_string(mTimeStoppedCounter / 10), -1, noColor, 1, shdwTxtColor); + textNokia2->writeDX(TXT_CENTER, PLAY_AREA_CENTER_X, PLAY_AREA_FIRST_QUARTER_Y, lang->getText(36) + std::to_string(mTimeStoppedCounter / 10), -1, noColor, 1, shdwTxtColor); } if (mTimeStoppedCounter > 100) { if (mTimeStoppedCounter % 30 == 0) { - JA_PlaySound(mSoundClock, false); + JA_PlaySound(clockSound, false); } } else { if (mTimeStoppedCounter % 15 == 0) { - JA_PlaySound(mSoundClock, false); + JA_PlaySound(clockSound, false); } } } @@ -3018,7 +3035,7 @@ void Game::renderMessages() { if (mDemo.counter % 30 > 14) { - mTextNokiaBig2->writeDX(TXT_CENTER, PLAY_AREA_CENTER_X, PLAY_AREA_FIRST_QUARTER_Y, mLang->getText(37), 0, noColor, 2, shdwTxtColor); + textNokiaBig2->writeDX(TXT_CENTER, PLAY_AREA_CENTER_X, PLAY_AREA_FIRST_QUARTER_Y, lang->getText(37), 0, noColor, 2, shdwTxtColor); } } @@ -3030,22 +3047,22 @@ void Game::renderMessages() if (stage == 10) { // Ultima fase - text = mLang->getText(79); + text = lang->getText(79); } else { // X fases restantes - text = std::to_string(11 - mStage[mCurrentStage].number) + mLang->getText(38); + text = std::to_string(11 - mStage[mCurrentStage].number) + lang->getText(38); } if (!mGameCompleted) { // Escribe el numero de fases restantes - mTextNokiaBig2->writeDX(TXT_CENTER, PLAY_AREA_CENTER_X, mStageBitmapPath[mStageBitmapCounter], text, -2, noColor, 2, shdwTxtColor); + textNokiaBig2->writeDX(TXT_CENTER, PLAY_AREA_CENTER_X, mStageBitmapPath[mStageBitmapCounter], text, -2, noColor, 2, shdwTxtColor); } else { // Escribe el texto de juego completado - text = mLang->getText(50); - mTextNokiaBig2->writeDX(TXT_CENTER, PLAY_AREA_CENTER_X, mStageBitmapPath[mStageBitmapCounter], text, -2, noColor, 1, shdwTxtColor); - mTextNokia2->writeDX(TXT_CENTER, PLAY_AREA_CENTER_X, mStageBitmapPath[mStageBitmapCounter] + mTextNokiaBig2->getCharacterSize() + 2, mLang->getText(76), -1, noColor, 1, shdwTxtColor); + text = lang->getText(50); + textNokiaBig2->writeDX(TXT_CENTER, PLAY_AREA_CENTER_X, mStageBitmapPath[mStageBitmapCounter], text, -2, noColor, 1, shdwTxtColor); + textNokia2->writeDX(TXT_CENTER, PLAY_AREA_CENTER_X, mStageBitmapPath[mStageBitmapCounter] + textNokiaBig2->getCharacterSize() + 2, lang->getText(76), -1, noColor, 1, shdwTxtColor); } } } @@ -3078,41 +3095,38 @@ void Game::disableTimeStopItem() void Game::shakeScreen() { const int v[] = {-1, 1, -1, 1, -1, 1, -1, 0}; - for (int n = 0; n < 8; n++) + for (int n = 0; n < 8; ++n) { // Prepara para empezar a dibujar en la textura de juego - mScreen->start(); + screen->start(); // Limpia la pantalla - mScreen->clean(bgColor); + screen->clean(bgColor); // Dibuja los objetos - mSpriteBackground->setPosX(0); - mSpriteBackground->setWidth(1); - mSpriteBackground->setSpriteClip(0, 0, 1, 192); + buildingsSprite->setPosX(0); + buildingsSprite->setWidth(1); + buildingsSprite->setSpriteClip(0, 0, 1, 160); renderBackground(); - mSpriteBackground->setPosX(255); - mSpriteBackground->setSpriteClip(255, 0, 1, 192); - mSpriteBackground->render(); + buildingsSprite->setPosX(255); + buildingsSprite->setSpriteClip(255, 0, 1, 160); + buildingsSprite->render(); - mSpriteBackground->setPosX(v[n]); - mSpriteBackground->setWidth(256); - mSpriteBackground->setSpriteClip(0, 0, 256, 192); - mSpriteBackground->render(); + buildingsSprite->setPosX(v[n]); + buildingsSprite->setWidth(256); + buildingsSprite->setSpriteClip(0, 0, 256, 160); + buildingsSprite->render(); - mSpriteGrass->render(); + grassSprite->render(); renderBalloons(); renderBullets(); renderItems(); - for (auto player : players) - { - player->render(); - } + renderPlayers(); renderScoreBoard(); // Vuelca el contenido del renderizador en pantalla - mScreen->blit(); + screen->blit(); SDL_Delay(50); } } @@ -3145,7 +3159,7 @@ section_t Game::run() { if (players.at(0)->isAlive()) { - JA_PlayMusic(mMusicPlaying); + JA_PlayMusic(gameMusic); } } } @@ -3165,7 +3179,7 @@ section_t Game::run() void Game::runPausedGame() { // Reinicia el menu - mMenuPause->reset(); + pauseMenu->reset(); while ((mSection.subsection == GAME_SECTION_PAUSE) && (mSection.name == PROG_SECTION_GAME)) { @@ -3179,9 +3193,9 @@ void Game::runPausedGame() mTicks = SDL_GetTicks(); // Actualiza la lógica del menu - mMenuPause->update(); - mFade->update(); - if (mFade->hasEnded()) + pauseMenu->update(); + fade->update(); + if (fade->hasEnded()) { mSection.name = PROG_SECTION_TITLE; mSection.subsection = TITLE_SECTION_1; @@ -3191,10 +3205,10 @@ void Game::runPausedGame() } // Prepara para empezar a dibujar en la textura de juego - mScreen->start(); + screen->start(); // Limpia la pantalla - mScreen->clean(bgColor); + screen->clean(bgColor); // Pinta el escenario { @@ -3205,11 +3219,7 @@ void Game::runPausedGame() renderItems(); renderSmartSprites(); renderScoreBoard(); - - for (auto player : players) - { - player->render(); - } + renderPlayers(); if ((mDeathCounter <= 150) && !players.at(0)->isAlive()) { @@ -3222,23 +3232,19 @@ void Game::runPausedGame() } renderFlashEffect(); - - mText->write(0, 0, std::to_string(balloons.size())); - - // Pinta la informacion de debug - renderDebugInfo(); } - mMenuPause->render(); - mFade->render(); + + pauseMenu->render(); + fade->render(); // Vuelca el contenido del renderizador en pantalla - mScreen->blit(); + screen->blit(); // Comprueba las entradas para el menu - mMenuPause->checkInput(); + pauseMenu->checkInput(); // Comprueba si se ha seleccionado algún item del menú - switch (mMenuPause->getItemSelected()) + switch (pauseMenu->getItemSelected()) { case 0: mSection.name = PROG_SECTION_GAME; @@ -3259,8 +3265,8 @@ void Game::runPausedGame() break; case 1: - mFade->setFadeType(FADE_CENTER); - mFade->activateFade(); + fade->setFadeType(FADE_CENTER); + fade->activateFade(); break; default: @@ -3276,15 +3282,15 @@ void Game::runGameOverScreen() saveScoreFile(); // Reinicia el menu - mMenuGameOver->reset(); + gameOverMenu->reset(); while ((mSection.subsection == GAME_SECTION_GAMEOVER) && (mSection.name == PROG_SECTION_GAME)) { // Comprueba los eventos que hay en la cola - while (SDL_PollEvent(mEventHandler) != 0) + while (SDL_PollEvent(eventHandler) != 0) { // Evento de salida de la aplicación - if (mEventHandler->type == SDL_QUIT) + if (eventHandler->type == SDL_QUIT) { mSection.name = PROG_SECTION_QUIT; break; @@ -3298,9 +3304,9 @@ void Game::runGameOverScreen() mTicks = SDL_GetTicks(); // Actualiza la lógica del menu - mMenuGameOver->update(); - mFade->update(); - if (mFade->hasEnded()) + gameOverMenu->update(); + fade->update(); + if (fade->hasEnded()) { switch (mPostFade) { @@ -3325,44 +3331,44 @@ void Game::runGameOverScreen() } // Prepara para empezar a dibujar en la textura de juego - mScreen->start(); + screen->start(); // Limpia la pantalla - mScreen->clean(bgColor); + screen->clean(bgColor); // Dibuja los objetos if (mNumPlayers == 1) { - mTextBig->writeCentered(PLAY_AREA_CENTER_X, PLAY_AREA_CENTER_Y - (BLOCK * 4), mLang->getText(43)); - mText->writeCentered(PLAY_AREA_CENTER_X, PLAY_AREA_CENTER_Y - (BLOCK * 1), mLang->getText(44) + std::to_string(players.at(0)->getScore())); + textBig->writeCentered(PLAY_AREA_CENTER_X, PLAY_AREA_CENTER_Y - (BLOCK * 4), lang->getText(43)); + text->writeCentered(PLAY_AREA_CENTER_X, PLAY_AREA_CENTER_Y - (BLOCK * 1), lang->getText(44) + std::to_string(players.at(0)->getScore())); } else { - mTextBig->writeCentered(PLAY_AREA_CENTER_X, PLAY_AREA_CENTER_Y - 36, mLang->getText(43)); - mText->writeCentered(PLAY_AREA_CENTER_X, PLAY_AREA_CENTER_Y - 12, mLang->getText(77) + std::to_string(players.at(0)->getScore())); - mText->writeCentered(PLAY_AREA_CENTER_X, PLAY_AREA_CENTER_Y, mLang->getText(78) + std::to_string(players.at(1)->getScore())); + textBig->writeCentered(PLAY_AREA_CENTER_X, PLAY_AREA_CENTER_Y - 36, lang->getText(43)); + text->writeCentered(PLAY_AREA_CENTER_X, PLAY_AREA_CENTER_Y - 12, lang->getText(77) + std::to_string(players.at(0)->getScore())); + text->writeCentered(PLAY_AREA_CENTER_X, PLAY_AREA_CENTER_Y, lang->getText(78) + std::to_string(players.at(1)->getScore())); } - mText->writeCentered(PLAY_AREA_CENTER_X, PLAY_AREA_CENTER_Y + BLOCK * 2, mLang->getText(45)); - mMenuGameOver->render(); - mFade->render(); + text->writeCentered(PLAY_AREA_CENTER_X, PLAY_AREA_CENTER_Y + BLOCK * 2, lang->getText(45)); + gameOverMenu->render(); + fade->render(); // Vuelca el contenido del renderizador en pantalla - mScreen->blit(); + screen->blit(); // Comprueba las entradas para el menu - mMenuGameOver->checkInput(); + gameOverMenu->checkInput(); // Comprueba si se ha seleccionado algún item del menú - switch (mMenuGameOver->getItemSelected()) + switch (gameOverMenu->getItemSelected()) { case 0: // YES mPostFade = 0; - mFade->activateFade(); + fade->activateFade(); break; case 1: // NO mPostFade = 1; - mFade->activateFade(); + fade->activateFade(); break; default: @@ -3371,27 +3377,6 @@ void Game::runGameOverScreen() } } -// Dibuja la informacion de debug en pantalla -void Game::renderDebugInfo() -{ - const color_t color = {0xFF, 0x20, 0x20}; - - if (mDebug.enabled) - { - mText->writeShadowed(2, 2 + 0 * BLOCK, "menace(umb): " + std::to_string(mMenaceCurrent) + "(" + std::to_string(mMenaceThreshold) + ")", color); - mText->writeShadowed(2, 2 + 1 * BLOCK, "currentPower: " + std::to_string(mStage[mCurrentStage].currentPower), color); - mText->writeShadowed(2, 2 + 2 * BLOCK, "mCurrentStage:" + std::to_string(mCurrentStage), color); - mText->writeShadowed(2, 2 + 3 * BLOCK, "mCounter: " + std::to_string(mCounter), color); - mText->writeShadowed(2, 2 + 4 * BLOCK, "(R)enemyset: " + std::to_string(mDebug.enemySet), color); - mText->writeShadowed(2, 2 + 5 * BLOCK, "RGB: " + std::to_string(mDebug.gradR) + "," + std::to_string(mDebug.gradG) + "," + std::to_string(mDebug.gradB), color); - mText->writeShadowed(2, 2 + 6 * BLOCK, "(I)invuln: " + std::to_string(players.at(0)->getInvulnerableCounter()), color); - mText->writeShadowed(2, 2 + 7 * BLOCK, "balloons: " + std::to_string(countBalloons()), color); - mText->writeShadowed(2, 2 + 8 * BLOCK, "balloonsPop: " + std::to_string(mBalloonsPopped), color); - mText->writeShadowed(2, 2 + 9 * BLOCK, "(Z-X)ballSped:" + std::to_string(mEnemySpeed), color); - mText->writeShadowed(2, 2 + 10 * BLOCK, "EGcounter: " + std::to_string(mGameCompletedCounter), color); - } -} - // Indica si se puede crear una powerball bool Game::canPowerBallBeCreated() { @@ -3447,7 +3432,7 @@ void Game::initPaths() } // Letrero de GetReady - const int size = mTextNokiaBig2->lenght(mLang->getText(75), -2); + const int size = textNokiaBig2->lenght(lang->getText(75), -2); const float start1 = PLAY_AREA_LEFT - size; const float finish1 = PLAY_AREA_CENTER_X - (size / 2); @@ -3542,17 +3527,17 @@ bool Game::allPlayersAreDead() // Comprueba los eventos que hay en cola void Game::checkEventHandler() { - while (SDL_PollEvent(mEventHandler) != 0) + while (SDL_PollEvent(eventHandler) != 0) { // Evento de salida de la aplicación - if (mEventHandler->type == SDL_QUIT) + if (eventHandler->type == SDL_QUIT) { mSection.name = PROG_SECTION_QUIT; break; } - else if (mEventHandler->type == SDL_KEYDOWN && mEventHandler->key.repeat == 0) + else if (eventHandler->type == SDL_KEYDOWN && eventHandler->key.repeat == 0) { - switch (mEventHandler->key.keysym.scancode) + switch (eventHandler->key.keysym.scancode) { case SDL_SCANCODE_P: createPowerBall(); diff --git a/source/game.h b/source/game.h index f627b98..acb52c9 100644 --- a/source/game.h +++ b/source/game.h @@ -36,12 +36,6 @@ #define NUMBER_OF_ENEMY_FORMATIONS 100 #define MAX_NUMBER_OF_ENEMIES_IN_A_FORMATION 50 -// Cantidad de elementos del vector de SmartSprites -#define MAX_SMART_SPRITES 10 - -// Cantidad máxima posible de balas -#define MAX_BULLETS 50 - // Porcentaje de aparición de los objetos #define ITEM_POINTS_1_DISK_ODDS 10 #define ITEM_POINTS_2_GAVINA_ODDS 6 @@ -51,9 +45,6 @@ #define ITEM_POWER_BALL_ODDS 0 #define ITEM_COFFEE_MACHINE_ODDS 4 -// Cantidad de objetos simultaneos -#define MAX_ITEMS 10 - // Valores para las variables asociadas a los objetos #define TIME_STOPPED_COUNTER 300 @@ -121,85 +112,84 @@ private: demoKeys_t dataFile[TOTAL_DEMO_DATA]; // Datos del fichero con los movimientos para la demo }; - struct debug_t - { - bool enabled; // Indica si se va a mostrar la información de debug - Uint8 enemySet; // Escoge el set enemigo a generar - Uint8 gradR, gradG, gradB; // Colores RGB para modificar el color del gradiente de fondo - float hudW, hudH; // Multiplica el tamaño del hud de debug; - }; + // Objetos + SDL_Renderer *renderer; // El renderizador de la ventana + Screen *screen; // Objeto encargado de dibujar en pantalla + Asset *asset; // Objeto que gestiona todos los ficheros de recursos + Lang *lang; // Objeto para gestionar los textos en diferentes idiomas + Input *input; // Manejador de entrada - SDL_Renderer *mRenderer; // El renderizador de la ventana - Screen *mScreen; // Objeto encargado de dibujar en pantalla - Asset *mAsset; // Objeto que gestiona todos los ficheros de recursos - Lang *mLang; // Objeto para gestionar los textos en diferentes idiomas - Input *mInput; // Manejador de entrada - - int mNumPlayers; // Numero de jugadores std::vector players; // Vector con los jugadores std::vector balloons; // Vector con los globos std::vector bullets; // Vector con las balas std::vector items; // Vector con los items std::vector smartSprites; // Vector con los smartsprites - LTexture *balloon1Texture; // Textura para los enemigos - LTexture *balloon2Texture; // Textura para los enemigos - LTexture *balloon3Texture; // Textura para los enemigos - LTexture *balloon4Texture; // Textura para los enemigos - LTexture *mTextureBullet; // Textura para las balas - LTexture *mTextureGameBG; // Textura para el fondo del juego - LTexture *mTextureGameText; // Textura para los sprites con textos - LTexture *mTextureItems; // Textura para los items + LTexture *balloon1Texture; // Textura para los globos + LTexture *balloon2Texture; // Textura para los globos + LTexture *balloon3Texture; // Textura para los globos + LTexture *balloon4Texture; // Textura para los globos + LTexture *bulletTexture; // Textura para las balas + + LTexture *gameBuildingsTexture; // Textura con los edificios de fondo + LTexture *gameCloudsTexture; // Textura con las nubes de fondo + LTexture *gameGrassTexture; // Textura con la hierba del suelo + LTexture *gamePowerMeterTexture; // Textura con el marcador de poder de la fase + LTexture *gameSkyColorsTexture; // Textura con los diferentes colores de fondo del juego + LTexture *gameTextTexture; // Textura para los sprites con textos + + LTexture *itemTexture; // Textura para los items std::vector *balloon1Animation; // Información para la animación de los globos std::vector *balloon2Animation; // Información para la animación de los globos std::vector *balloon3Animation; // Información para la animación de los globos std::vector *balloon4Animation; // Información para la animación de los globos - Text *mText; // Fuente para los textos del juego - Text *mTextBig; // Fuente de texto grande - Text *mTextScoreBoard; // Fuente para el marcador del juego - Text *mTextNokia2; // Otra fuente de texto para mesajes - Text *mTextNokiaBig2; // Y la versión en grande + Text *text; // Fuente para los textos del juego + Text *textBig; // Fuente de texto grande + Text *textScoreBoard; // Fuente para el marcador del juego + Text *textNokia2; // Otra fuente de texto para mesajes + Text *textNokiaBig2; // Y la versión en grande - Menu *mMenuGameOver; // Menú de la pantalla de game over - Menu *mMenuPause; // Menú de la pantalla de pausa + Menu *gameOverMenu; // Menú de la pantalla de game over + Menu *pauseMenu; // Menú de la pantalla de pausa - Fade *mFade; // Objeto para renderizar fades - SDL_Event *mEventHandler; // Manejador de eventos + Fade *fade; // Objeto para renderizar fades + SDL_Event *eventHandler; // Manejador de eventos - MovingSprite *mClouds1a; // Sprite para las nubes superiores - MovingSprite *mClouds1b; // Sprite para las nubes superiores - MovingSprite *mClouds2a; // Sprite para las nubes inferiores - MovingSprite *mClouds2b; // Sprite para las nubes inferiores - SmartSprite *m1000Bitmap; // Sprite con el texto 1.000 - SmartSprite *m2500Bitmap; // Sprite con el texto 2.500 - SmartSprite *m5000Bitmap; // Sprite con el texto 5.000 - Sprite *mSpriteBackground; // Sprite con los graficos frontales del fondo - Sprite *mSpriteGetReady; // Sprite para el texto de GetReady del principio de la partida - Sprite *mSpriteGradient; // Sprite con los graficos del degradado de color de fondo - Sprite *mSpriteGrass; // Sprite para la hierba - Sprite *mSpritePowerMeter; // Sprite para el medidor de poder de la fase - Sprite *mSpriteScoreBoard; // Sprite para el fondo del marcador + MovingSprite *clouds1A; // Sprite para las nubes superiores + MovingSprite *clouds1B; // Sprite para las nubes superiores + MovingSprite *clouds2A; // Sprite para las nubes inferiores + MovingSprite *clouds2B; // Sprite para las nubes inferiores + SmartSprite *n1000Sprite; // Sprite con el texto 1.000 + SmartSprite *n2500Sprite; // Sprite con el texto 2.500 + SmartSprite *n5000Sprite; // Sprite con el texto 5.000 - JA_Sound mSoundBalloon; // Sonido para la explosión del globo - JA_Sound mSoundBullet; // Sonido para los disparos - JA_Sound mSoundPlayerCollision; // Sonido para la colisión del jugador con un enemigo - JA_Sound mSoundHiScore; // Sonido para cuando se alcanza la máxima puntuación - JA_Sound mSoundItemDrop; // Sonido para cuando se genera un item - JA_Sound mSoundItemPickup; // Sonido para cuando se recoge un item - JA_Sound mSoundCoffeeOut; // Sonido para cuando el jugador pierde el café al recibir un impacto - JA_Sound mSoundStageChange; // Sonido para cuando se cambia de fase - JA_Sound mSoundBubble1; // Sonido para cuando el jugador muere - JA_Sound mSoundBubble2; // Sonido para cuando el jugador muere - JA_Sound mSoundBubble3; // Sonido para cuando el jugador muere - JA_Sound mSoundBubble4; // Sonido para cuando el jugador muere - JA_Sound mSoundClock; // Sonido para cuando se detiene el tiempo con el item reloj - JA_Sound mSoundPowerBall; // Sonido para cuando se explota una Power Ball - JA_Sound mSoundCollision; // Sonido para cuando la máquina de café toca el suelo + Sprite *buildingsSprite; // Sprite con los edificios de fondo + Sprite *skyColorsSprite; // Sprite con los graficos del degradado de color de fondo + Sprite *grassSprite; // Sprite para la hierba + Sprite *powerMeterSprite; // Sprite para el medidor de poder de la fase - JA_Music mMusicPlaying; // Musica de fondo + JA_Sound balloonSound; // Sonido para la explosión del globo + JA_Sound bulletSound; // Sonido para los disparos + JA_Sound playerCollisionSound; // Sonido para la colisión del jugador con un enemigo + JA_Sound hiScoreSound; // Sonido para cuando se alcanza la máxima puntuación + JA_Sound itemDropSound; // Sonido para cuando se genera un item + JA_Sound itemPickUpSound; // Sonido para cuando se recoge un item + JA_Sound coffeeOutSound; // Sonido para cuando el jugador pierde el café al recibir un impacto + JA_Sound stageChangeSound; // Sonido para cuando se cambia de fase + JA_Sound bubble1Sound; // Sonido para cuando el jugador muere + JA_Sound bubble2Sound; // Sonido para cuando el jugador muere + JA_Sound bubble3Sound; // Sonido para cuando el jugador muere + JA_Sound bubble4Sound; // Sonido para cuando el jugador muere + JA_Sound clockSound; // Sonido para cuando se detiene el tiempo con el item reloj + JA_Sound powerBallSound; // Sonido para cuando se explota una Power Ball + JA_Sound coffeeMachineSound; // Sonido para cuando la máquina de café toca el suelo + JA_Music gameMusic; // Musica de fondo + + // Variables + int mNumPlayers; // Numero de jugadores Uint32 mTicks; // Contador de ticks para ajustar la velocidad del programa Uint8 mTicksSpeed; // Velocidad a la que se repiten los bucles del programa @@ -219,7 +209,7 @@ private: Uint16 mTimeStoppedCounter; // Temporizador para llevar la cuenta del tiempo detenido Uint32 mCounter; // Contador para el juego Uint32 mScoreDataFile[TOTAL_SCORE_DATA]; // Datos del fichero de puntos - SDL_Rect mGradientRect[4]; // Vector con las coordenadas de los 4 gradientes + SDL_Rect skyColorsRect[4]; // Vector con las coordenadas de los 4 colores de cielo Uint16 mBalloonsPopped; // Lleva la cuenta de los globos explotados Uint8 mLastEnemyDeploy; // Guarda cual ha sido la última formación desplegada para no repetir; int mEnemyDeployCounter; // Cuando se lanza una formación, se le da un valor y no sale otra hasta que llegue a cero @@ -242,8 +232,7 @@ private: enemyPool_t mEnemyPool[10]; // Variable con los diferentes conjuntos de formaciones enemigas Uint8 mLastStageReached; // Contiene el numero de la última pantalla que se ha alcanzado - demo_t mDemo; // Variable con todas las variables relacionadas con el modo demo - debug_t mDebug; // Variable con las opciones de debug + demo_t mDemo; // Variable con todas las variables relacionadas con el modo demo // Actualiza el juego void update(); @@ -303,7 +292,10 @@ private: void renderScoreBoard(); // Actualiza las variables del jugador - void updatePlayer(); + void updatePlayers(); + + // Dibuja a los jugadores + void renderPlayers(); // Actualiza las variables de la fase void updateStage(); @@ -488,9 +480,6 @@ private: // Bucle para la pantalla de game over void runGameOverScreen(); - // Dibuja la informacion de debug en pantalla - void renderDebugInfo(); - // Indica si se puede crear una powerball bool canPowerBallBeCreated(); @@ -517,7 +506,7 @@ private: public: // Constructor - Game(int numPlayers, int currentStage, SDL_Renderer *renderer, Screen *screen, Asset *mAsset, Lang *lang, Input *input, bool demo, options_t *options); + Game(int numPlayers, int currentStage, SDL_Renderer *renderer, Screen *screen, Asset *asset, Lang *lang, Input *input, bool demo, options_t *options); // Destructor ~Game(); diff --git a/todo.txt b/todo.txt index 949adae..ee0cc27 100644 --- a/todo.txt +++ b/todo.txt @@ -1,4 +1,4 @@ -los items se quedan pegados en el techo (comprobar si sigue pasando, he cambiado la coreción al chocar arriba. Si sigue fallando se quita la comprobación superior) +x los items se quedan pegados en el techo (comprobar si sigue pasando, he cambiado la coreción al chocar arriba. Si sigue fallando se quita la comprobación superior) x la maquina de cafe no toca el suelo x las bolas verdes nacen naranja al explotarlas falta el aura de superguerrero al pillar la maquina de cafe