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,19 +1805,23 @@ static int brickmania_game_loop(void)
short touch_x, touch_y; short touch_x, touch_y;
touch_x = FIXED3(rb->button_get_data() >> 16); touch_x = FIXED3(rb->button_get_data() >> 16);
touch_y = FIXED3(rb->button_get_data() & 0xffff); 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) * pad_pos_x = GAMESCREEN_WIDTH - (touch_x - pad_width/2);
(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;
} }
else
{
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) if(button & BUTTON_REL)
button = SELECT; button = SELECT;