god angry
This commit is contained in:
parent
bdbcd4eec2
commit
c85d677afa
@ -11,6 +11,7 @@ enum class GodState{
|
||||
RETRIEVE1,
|
||||
RETRIEVE2,
|
||||
THROW,
|
||||
YOLO,
|
||||
};
|
||||
// I don't want to put that in config, I feel like it would be useless and overkill at this point
|
||||
#define GOD_BENCH_SIZE 64
|
||||
|
@ -65,7 +65,7 @@ public:
|
||||
|
||||
void drawGodRightHand(const Position& pos) const;
|
||||
void drawGodLeftHand(const Position& pos) const;
|
||||
void drawGodFace(int y) const;
|
||||
void drawGodFace(int y, bool angry=false) const;
|
||||
|
||||
private:
|
||||
// Explanation for choices :
|
||||
|
@ -102,10 +102,11 @@ void PixelManager::drawGodLeftHand(const Position& pos) const {
|
||||
drawSprite(leftHand, pos);
|
||||
}
|
||||
|
||||
void PixelManager::drawGodFace(int y) const {
|
||||
void PixelManager::drawGodFace(int y, bool angry) const {
|
||||
Text t(
|
||||
Position(getScreenWidth()/2, y),
|
||||
".w.", nsGraphics::KBlue,
|
||||
angry ? ">w<" : ".w.",
|
||||
nsGraphics::KBlue,
|
||||
GlutFont::GlutFonts::BITMAP_TIMES_ROMAN_24,
|
||||
Text::HorizontalAlignment::ALIGNH_CENTER
|
||||
);
|
||||
|
@ -17,7 +17,7 @@ void PixelManager::displayMenu(const Position& pos, Menu& currentMenu){
|
||||
startFrame();
|
||||
size_t margin = 0;
|
||||
size_t cpt = 0;
|
||||
for(auto& value : currentMenu.entries ){
|
||||
for(string& value : currentMenu.entries ){
|
||||
displayButton(Position(0,0+margin)+ pos, value, (currentMenu.currentValue == cpt) ? currentMenu.selectedColor : currentMenu.unSelectedColor );
|
||||
++cpt;
|
||||
margin += 50;
|
||||
|
@ -54,7 +54,7 @@ bool Game::manageGod() {
|
||||
god.counter -= 2;
|
||||
return false;
|
||||
}
|
||||
if(god.thrownInvType==InvaderType::NONE){
|
||||
if (god.thrownInvType == InvaderType::NONE) {
|
||||
god.state = GodState::WAIT;
|
||||
return false;
|
||||
}
|
||||
@ -89,12 +89,12 @@ bool Game::manageGod() {
|
||||
bool touched = false;
|
||||
|
||||
// check if OOB (Out Of Bounds)
|
||||
if (invaderPos.getY()+confData.invadersSize >= pm.getScreenWidth() ||
|
||||
if (invaderPos.getY() + confData.invadersSize >= pm.getScreenWidth() ||
|
||||
(invaderPos.getX() < 0 || invaderPos.getX() + confData.invadersSize >= pm.getScreenWidth())) {
|
||||
touched = true;
|
||||
// check player collision
|
||||
} else if (invaderPos.getY() + confData.invadersSize >= pm.getScreenHeight() - PLAYER_HEIGHT) {
|
||||
for (Player& p: players) {
|
||||
for (Player &p: players) {
|
||||
if (areLinesColliding(
|
||||
p.x, p.x + confData.playersWidth,
|
||||
invaderPos.getX(), invaderPos.getX() + confData.invadersSize
|
||||
@ -105,7 +105,7 @@ bool Game::manageGod() {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (touched){
|
||||
if (touched) {
|
||||
god.state = GodState::WAIT;
|
||||
god.counter = 0;
|
||||
}
|
||||
@ -113,8 +113,11 @@ bool Game::manageGod() {
|
||||
* we do not need to reset other members, they'll be treated as non-initialized
|
||||
* When we cycle back between states
|
||||
*/
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case GodState::YOLO: {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user