diff options
author | Tomer Shalev <shalev.tomer@gmail.com> | 2010-03-27 18:23:43 +0000 |
---|---|---|
committer | Tomer Shalev <shalev.tomer@gmail.com> | 2010-03-27 18:23:43 +0000 |
commit | 857e946923b5224053e8c2820456c5fbe404b9d6 (patch) | |
tree | df377ea1007b8d8558277dae09bf63e2c8edb28f | |
parent | 8e8d2c2a5b9550307f97e4396cacdfd00caabf21 (diff) |
Brickmania: Prevent a ball that is sticked to the edge of the pad from being fired outside the screen's region when the pad is moved all the way to the screen's edge
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25357 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/plugins/brickmania.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/apps/plugins/brickmania.c b/apps/plugins/brickmania.c index a4adcc29d0..13827edb53 100644 --- a/apps/plugins/brickmania.c +++ b/apps/plugins/brickmania.c @@ -2272,7 +2272,14 @@ static int brickmania_game_loop(void) for(k=0;k<used_balls;k++) { if (game_state==ST_READY || ball[k].glue) + { ball[k].pos_x+=dx; + + if (ball[k].pos_x < HALFBALL) + ball[k].pos_x = HALFBALL; + else if (ball[k].pos_x > GAMESCREEN_WIDTH - HALFBALL) + ball[k].pos_x = GAMESCREEN_WIDTH - HALFBALL; + } } } } |