removed last TODO
This commit is contained in:
parent
b7632df576
commit
9dc5a03427
@ -221,10 +221,10 @@ private:
|
|||||||
bool invadersTouchPlayer() const;
|
bool invadersTouchPlayer() const;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief change god's state to awake
|
* @brief Try to awake god, if not already awaken
|
||||||
* @fn void awakeGod();
|
* @fn void tryAwakeGod();
|
||||||
*/
|
*/
|
||||||
void awakeGod();
|
void tryAwakeGod();
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief make god behave
|
* @brief make god behave
|
||||||
|
@ -108,10 +108,7 @@ WinValue Game::enterGameLoop(){ // returns when game is finished
|
|||||||
managePlayers();
|
managePlayers();
|
||||||
if(manageInvaders()) { // if they went down
|
if(manageInvaders()) { // if they went down
|
||||||
if (invadersTouchPlayer())return WinValue::INVADERS;
|
if (invadersTouchPlayer())return WinValue::INVADERS;
|
||||||
// TODO abstract this ?
|
tryAwakeGod();
|
||||||
if (basePos.getY() > 100 /*lambda value*/ && god.state==GodState::NONE) {
|
|
||||||
awakeGod();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(manageGod())return WinValue::PLAYERS;
|
if(manageGod())return WinValue::PLAYERS;
|
||||||
|
@ -10,9 +10,11 @@
|
|||||||
|
|
||||||
#include "game.h"
|
#include "game.h"
|
||||||
|
|
||||||
void Game::awakeGod() {
|
void Game::tryAwakeGod() {
|
||||||
god.counter = 0;
|
if (basePos.getY() > 100 /*lambda value*/ && god.state==GodState::NONE) {
|
||||||
god.state = GodState::AWAKE;
|
god.counter = 0;
|
||||||
|
god.state = GodState::AWAKE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user