From 4fd59d8edf8be17978678987e9510d5c773e5317 Mon Sep 17 00:00:00 2001 From: Christian Kroll Date: Sat, 17 May 2014 18:08:43 +0200 Subject: [PATCH] NUM_COLS and NUM_ROWS were mixed up at some places --- src/games/breakout/playfield.c | 10 +++++----- src/games/breakout/rebound.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/games/breakout/playfield.c b/src/games/breakout/playfield.c index eeac23d..df24d32 100644 --- a/src/games/breakout/playfield.c +++ b/src/games/breakout/playfield.c @@ -67,7 +67,7 @@ static void brick_damage (int8_t in_x, int8_t in_y) void playfield_set (uint8_t in_x, uint8_t in_y, game_field_t in_field) { - if (in_x >= NUM_ROWS || in_y >= NUM_COLS) + if (in_x >= NUM_COLS || in_y >= NUM_ROWS) { return; } @@ -78,10 +78,10 @@ int8_t check_bounce (int8_t in_x, int8_t in_y) { int8_t ov = 0; /* overflow check */ - if (in_x >= NUM_ROWS || in_x < 0) + if (in_x >= NUM_COLS || in_x < 0) ov |= BOUNCE_X; - if (in_y >= NUM_COLS || in_y < 0) + if (in_y >= NUM_ROWS || in_y < 0) ov |= BOUNCE_Y; if (ov) @@ -119,9 +119,9 @@ void playfield_draw () { uint8_t x,y; - for (x=0;x