13void Game::tryAwakeGod() {
26bool Game::manageGod() {
87 if (players.size() == 1)target =
PLAYER1;
88 else target = rand() % players.size();
107 invaderPos = invaderPos + a;
109 bool touched =
false;
112 if (invaderPos.getY() + confData.
invadersSize >= pm->getScreenWidth() ||
113 (invaderPos.getX() < 0 || invaderPos.getX() + confData.
invadersSize >= pm->getScreenWidth())) {
118 if(!areThereInvadersLeft())
return true;
122 for (
Player &p: players) {
126 invaderPos.getX(), invaderPos.getX() + confData.
invadersSize
147 throw runtime_error(
"SHOULD NOT HAPPEN : invalid action for god : ID="+ to_string(
static_cast<int>(god.
state)));
unsigned counter
manage all sorts of things, gods secrets remains unknown
unsigned thrownInvPosY
y pixel coordinate of the invader thrown by the hand of god
Position thrownTransition
position of a point for bezier's curve
Position getRightHandPos(unsigned screenWidth) const
give initial the pixel coordinates of god's right hand
Position thrownVector
direction of the thrown invader movement
GodState state
god's current state
InvaderType thrownInvType
type of the invader thrown by the hand of god
unsigned thrownInvPosX
x pixel coordinate of the invader thrown by the hand of god
unsigned randomValidCol() const
full game logic and display management
#define GOD_HAND_DISTANCE
unsigned playersWidth
player horizontal size in pixel
unsigned invadersSize
invader radius size in pixel
bool areLinesColliding(unsigned start1, unsigned end1, unsigned start2, unsigned end2)
tells if 2 lines are colliding in a 1 dimentionnal space
void applyTransformation(Position &pos, unsigned sizeFrom, unsigned sizeTo)
change the size of a Position object
nsGraphics::Vec2D Position