Browse Source

Fix Invaders game compile error (#13575)

drzejkopf 6 years ago
parent
commit
0992d1a4c8
1 changed files with 7 additions and 5 deletions
  1. 7
    5
      Marlin/src/lcd/menu/game/invaders.cpp

+ 7
- 5
Marlin/src/lcd/menu/game/invaders.cpp View File

182
 
182
 
183
 uint8_t cannons_left;
183
 uint8_t cannons_left;
184
 int8_t cannon_x;
184
 int8_t cannon_x;
185
-laser_t laser, expl, bullet[10];
185
+laser_t explod, laser, bullet[10];
186
 constexpr uint8_t inv_off[] = { 2, 1, 0 }, inv_wide[] = { 8, 11, 12 };
186
 constexpr uint8_t inv_off[] = { 2, 1, 0 }, inv_wide[] = { 8, 11, 12 };
187
 int8_t invaders_x, invaders_y, invaders_dir, leftmost, rightmost, botmost;
187
 int8_t invaders_x, invaders_y, invaders_dir, leftmost, rightmost, botmost;
188
 uint8_t invader_count, quit_count, bugs[INVADER_ROWS], shooters[(INVADER_ROWS) * (INVADER_COLS)];
188
 uint8_t invader_count, quit_count, bugs[INVADER_ROWS], shooters[(INVADER_ROWS) * (INVADER_COLS)];
236
 }
236
 }
237
 
237
 
238
 inline void explode(const int8_t x, const int8_t y, const int8_t v=4) {
238
 inline void explode(const int8_t x, const int8_t y, const int8_t v=4) {
239
-  expl.x = x - (EXPL_W) / 2; expl.y = y; expl.v = v;
239
+  explod.x = x - (EXPL_W) / 2;
240
+  explod.y = y;
241
+  explod.v = v;
240
 }
242
 }
241
 
243
 
242
 inline void kill_cannon(uint8_t &game_state, const uint8_t st) {
244
 inline void kill_cannon(uint8_t &game_state, const uint8_t st) {
431
   }
433
   }
432
 
434
 
433
   // Draw explosion
435
   // Draw explosion
434
-  if (expl.v && PAGE_CONTAINS(expl.y, expl.y + 7 - 1)) {
435
-    u8g.drawBitmapP(expl.x, expl.y, 2, 7, explosion);
436
-    --expl.v;
436
+  if (explod.v && PAGE_CONTAINS(explod.y, explod.y + 7 - 1)) {
437
+    u8g.drawBitmapP(explod.x, explod.y, 2, 7, explosion);
438
+    --explod.v;
437
   }
439
   }
438
 
440
 
439
   // Blink GAME OVER when game is over
441
   // Blink GAME OVER when game is over

Loading…
Cancel
Save