I'm depressed help

This commit is contained in:
Thomas 2022-01-10 09:23:08 +01:00
parent a10a1e67c5
commit 7a816b5f71
No known key found for this signature in database
GPG Key ID: E538821A6CDFDAD7
4 changed files with 10 additions and 12 deletions

View File

@ -26,8 +26,8 @@ players:
invaders: invaders:
fireCooldown: 20 fireCooldown: 20
size: 40 size: 40
speed: 7 speed: 5
distance: 10 # distance in pixels between invaders distance: 40 # distance in pixels between invaders
typeA: typeA:
points: 100 points: 100

View File

@ -221,8 +221,6 @@ private:
*/ */
bool invadersTouchPlayer() const; bool invadersTouchPlayer() const;
// god things
/*! /*!
* @brief change god's state to awake * @brief change god's state to awake
* @fn void awakeGod(); * @fn void awakeGod();

View File

@ -203,10 +203,10 @@ bool Game::checkTorpedosAndInvaders() {
} }
bool Game::invadersTouchPlayer() const { bool Game::invadersTouchPlayer() const {
for(const InvadersColumn& line : grid){ return any_of(grid.begin(), grid.end(), [this](const InvadersColumn& line) -> bool {
if(basePos.getY() + line.size() * confData.invadersSize >= pm.getScreenHeight() - PLAYER_HEIGHT){ unsigned outter = line.getOutterInvader();
return true; return this->basePos.getY()+confData.invadersSize*(outter+1)
} +confData.invadersDistance*outter
} >= pm.getScreenHeight() - PLAYER_HEIGHT;
return false; });
} }