From 1351e8fe934368da35724ba60014fc9be5dd5a8d Mon Sep 17 00:00:00 2001 From: Thomas Date: Tue, 11 Jan 2022 15:23:40 +0100 Subject: [PATCH] things --- headers/pixelManager/pixelManager.h | 2 +- src/game/gameManagers.cpp | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/headers/pixelManager/pixelManager.h b/headers/pixelManager/pixelManager.h index e8048e0..11e7748 100644 --- a/headers/pixelManager/pixelManager.h +++ b/headers/pixelManager/pixelManager.h @@ -144,7 +144,7 @@ public: */ virtual void drawTorpedo(const Position& baseVector, unsigned width, const nsGraphics::RGBAcolor& color) const; -#define HEART_LENGTH 40 +#define HEART_LENGTH 64 /*! * @brief display a singular heart on screen diff --git a/src/game/gameManagers.cpp b/src/game/gameManagers.cpp index f5f2089..abfe630 100644 --- a/src/game/gameManagers.cpp +++ b/src/game/gameManagers.cpp @@ -13,6 +13,12 @@ #define ISPRESSED(ID, X) window.isPressed({confData.playerDefs[ID].keys.X, false}) void Game::manageOnePlayer(playerID pID){ Player& p = players[pID]; + if(p.hasDeathAnimation()) { + ++p.deathAnimCounter; + if (p.deathAnimCounter == 75) { + p.deathAnimCounter = 0; + } + } if(p.isEliminated())return; if (ISPRESSED(pID, left)){ @@ -25,14 +31,7 @@ void Game::manageOnePlayer(playerID pID){ } - if(p.hasDeathAnimation()) { - ++p.deathAnimCounter; - if (p.deathAnimCounter == 75) { - p.deathAnimCounter = 0; - } - }else{ - if(p.isEliminated())return; - + if(!p.hasDeathAnimation()) { if(p.fireCooldown==0) { if (ISPRESSED(pID, shoot)) { torpedos.emplace_back(p.x + confData.playersWidth / 2, pm->getScreenHeight() - PLAYER_HEIGHT, pID);