M ball.cpp => ball.cpp +1 -1
@@ 323,7 323,7 @@ void Ball_Draw() {
void Ball_FlushRemoveQueue() {
balls.processRemoveQueue();
- if (balls.count() == 0) {
+ if (Game_Playing() && (balls.count() == 0)) {
Game_Loss();
}
}
M game.cpp => game.cpp +4 -10
@@ 852,22 852,16 @@ int Game_Run() {
if (state < STATE_GAME_CENTERSHIP) {
gameLevel->disp(); // draw blocks
}
- if (state == STATE_GAME_PLAY) {
- Enemy_Run();
- Capsule_Draw();
- }
+
+ Enemy_Run();
+ Capsule_Draw();
Laser_Draw();
Game_DrawShip();
Ball_Draw(); // draw balls
Capsule_FlushRemoveQueue();
Enemy_FlushRemoveQueue();
-
- // this will cause a state change to STATE_GAME_LOSS if there's no balls
- // so we only want it in STATE_GAME_PLAY
- if (state == STATE_GAME_PLAY) {
- Ball_FlushRemoveQueue();
- }
+ Ball_FlushRemoveQueue();
gameLevel->flushRemoveQueue();
}
M mover.cpp => mover.cpp +4 -0
@@ 78,6 78,10 @@ void Mover::initialize() {
// movement with this method. Because of this, I instead use the speeds to set "target" coordinates
// that get jumped to every 4 frames, and then do "tweening" to make the movement smooth.
void Mover::move() {
+ if (!Game_Playing()) {
+ return;
+ }
+
timer += Speed_Multiplier();
if (timer >= MOVE_TIMING) {
timer = 0;