This commit is contained in:
Thomas 2022-01-11 15:23:40 +01:00
parent f50b9991a6
commit 1351e8fe93
No known key found for this signature in database
GPG Key ID: E538821A6CDFDAD7
2 changed files with 8 additions and 9 deletions

View File

@ -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

View File

@ -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);