1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Karl Kurbjun 2009-10-04 21:11:51 +00:00
parent 4a6c040568
commit 1fc595fb87

View file

@ -1805,10 +1805,15 @@ 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 = (flip_sides ? -1 : 1) *
(touch_x - pad_width/2);
pad_pos_x = GAMESCREEN_WIDTH - (touch_x - pad_width/2);
}
else
{
pad_pos_x = (touch_x - pad_width/2);
}
if(pad_pos_x < 0)
pad_pos_x = 0;
@ -1817,7 +1822,6 @@ 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 = pad_pos_x+pad_width/2;
}
if(button & BUTTON_REL)
button = SELECT;