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:
parent
4a6c040568
commit
1fc595fb87
1 changed files with 15 additions and 11 deletions
|
@ -1805,19 +1805,23 @@ 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)
|
||||
{
|
||||
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;
|
||||
if(flip_sides)
|
||||
{
|
||||
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;
|
||||
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue