summaryrefslogtreecommitdiff
path: root/apps/plugins/brickmania.c
diff options
context:
space:
mode:
authorKarl Kurbjun <kkurbjun@gmail.com>2009-10-04 21:11:51 +0000
committerKarl Kurbjun <kkurbjun@gmail.com>2009-10-04 21:11:51 +0000
commit1fc595fb87edaacb44186efb36654815175de28f (patch)
treed9ab5620e3d53ef88289e96e85d25511e136e1de /apps/plugins/brickmania.c
parent4a6c04056832a25cda626617a71abfcdae6dbbcb (diff)
Brickmania: Fix the flip-sides powerup with touchscreen and make the whole gameboard available to position the paddle
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22926 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/brickmania.c')
-rw-r--r--apps/plugins/brickmania.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/apps/plugins/brickmania.c b/apps/plugins/brickmania.c
index 3a754b3e9e..e5f953ac8d 100644
--- a/apps/plugins/brickmania.c
+++ b/apps/plugins/brickmania.c
@@ -1805,20 +1805,24 @@ static int brickmania_game_loop(void)
short touch_x, touch_y;
touch_x = FIXED3(rb->button_get_data() >> 16);
touch_y = FIXED3(rb->button_get_data() & 0xffff);
- if(touch_y >= (GAMESCREEN_HEIGHT-GAMESCREEN_HEIGHT/4) && touch_y <= GAMESCREEN_HEIGHT)
+
+ if(flip_sides)
+ {
+ pad_pos_x = GAMESCREEN_WIDTH - (touch_x - pad_width/2);
+ }
+ else
{
- pad_pos_x = (flip_sides ? -1 : 1) *
- (touch_x - pad_width/2);
-
- if(pad_pos_x < 0)
- pad_pos_x = 0;
- else if(pad_pos_x+pad_width > GAMESCREEN_WIDTH)
- pad_pos_x = GAMESCREEN_WIDTH-pad_width;
- for(k=0;k<used_balls;k++)
- if (game_state==ST_READY || ball[k].glue)
- ball[k].pos_x = pad_pos_x+pad_width/2;
+ pad_pos_x = (touch_x - pad_width/2);
}
+ if(pad_pos_x < 0)
+ pad_pos_x = 0;
+ else if(pad_pos_x+pad_width > GAMESCREEN_WIDTH)
+ pad_pos_x = GAMESCREEN_WIDTH-pad_width;
+ for(k=0;k<used_balls;k++)
+ if (game_state==ST_READY || ball[k].glue)
+ ball[k].pos_x = pad_pos_x+pad_width/2;
+
if(button & BUTTON_REL)
button = SELECT;
}