summaryrefslogtreecommitdiff
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
parent4a6c04056832a25cda626617a71abfcdae6dbbcb (diff)
downloadrockbox-1fc595fb87edaacb44186efb36654815175de28f.tar.gz
rockbox-1fc595fb87edaacb44186efb36654815175de28f.zip
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
-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)
1805 short touch_x, touch_y; 1805 short touch_x, touch_y;
1806 touch_x = FIXED3(rb->button_get_data() >> 16); 1806 touch_x = FIXED3(rb->button_get_data() >> 16);
1807 touch_y = FIXED3(rb->button_get_data() & 0xffff); 1807 touch_y = FIXED3(rb->button_get_data() & 0xffff);
1808 if(touch_y >= (GAMESCREEN_HEIGHT-GAMESCREEN_HEIGHT/4) && touch_y <= GAMESCREEN_HEIGHT) 1808
1809 if(flip_sides)
1810 {
1811 pad_pos_x = GAMESCREEN_WIDTH - (touch_x - pad_width/2);
1812 }
1813 else
1809 { 1814 {
1810 pad_pos_x = (flip_sides ? -1 : 1) * 1815 pad_pos_x = (touch_x - pad_width/2);
1811 (touch_x - pad_width/2);
1812
1813 if(pad_pos_x < 0)
1814 pad_pos_x = 0;
1815 else if(pad_pos_x+pad_width > GAMESCREEN_WIDTH)
1816 pad_pos_x = GAMESCREEN_WIDTH-pad_width;
1817 for(k=0;k<used_balls;k++)
1818 if (game_state==ST_READY || ball[k].glue)
1819 ball[k].pos_x = pad_pos_x+pad_width/2;
1820 } 1816 }
1821 1817
1818 if(pad_pos_x < 0)
1819 pad_pos_x = 0;
1820 else if(pad_pos_x+pad_width > GAMESCREEN_WIDTH)
1821 pad_pos_x = GAMESCREEN_WIDTH-pad_width;
1822 for(k=0;k<used_balls;k++)
1823 if (game_state==ST_READY || ball[k].glue)
1824 ball[k].pos_x = pad_pos_x+pad_width/2;
1825
1822 if(button & BUTTON_REL) 1826 if(button & BUTTON_REL)
1823 button = SELECT; 1827 button = SELECT;
1824 } 1828 }