Skip to content

Commit

Permalink
Added an easter egg ;)
Browse files Browse the repository at this point in the history
  • Loading branch information
RonWeber committed Feb 14, 2016
1 parent 029e738 commit eea5bd0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions GameLogic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ GameLogic::GameLogic() : player(100, 100, 0)
GameLogic::~GameLogic()
{
}
int buttonLast = 0;
void GameLogic::step(const Uint8 *keyboard)
{
player.right_btn = keyboard[SDL_SCANCODE_RIGHT];
Expand All @@ -21,6 +22,9 @@ void GameLogic::step(const Uint8 *keyboard)
}
SDL_UnlockMutex(write_other_players);

if (keyboard[SDL_SCANCODE_F] && !buttonLast) player.multiplier *= 1.5;
buttonLast = keyboard[SDL_SCANCODE_F];

if (multiplayer && turns == 3)
{
send_packet(&player, rings.thisRing);
Expand Down
4 changes: 2 additions & 2 deletions Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ void Player::step(std::vector<Bumper>* bumpers)
if (left_btn)
aspd -= .15;
if (up_btn) {
xspd += xdir(angle, .05);
yspd += ydir(angle, .05);
xspd += xdir(angle, .05) * multiplier;
yspd += ydir(angle, .05) * multiplier;
myExhaust.add(x, y, xdir(angle,-5)+xspd, ydir(angle, -5)+yspd);
myExhaust.add(x, y, xdir(angle + fRandGFX(-20, 20), -4.8) + xspd, ydir(angle + fRandGFX(-20, 20), -4.8) + yspd);
myExhaust.add(x, y, xdir(angle + fRandGFX(-20, 20), -5.2) + xspd, ydir(angle + fRandGFX(-20, 20), -5.2) + yspd);
Expand Down
5 changes: 3 additions & 2 deletions Player.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ class Player
void step(std::vector<Bumper>* bumpers);
void draw();
double x, y, xspd, yspd, angle, aspd;
Uint8 left_btn, right_btn, up_btn;
double multiplier = 1;
Uint8 left_btn, right_btn, up_btn, special_btn;
Exhaust myExhaust;
int colorRed;

int special_timeout = 0;
};

class ActivePlayer : public Player
Expand Down

0 comments on commit eea5bd0

Please sign in to comment.