summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Kukla <roolku@rockbox.org>2009-07-26 19:51:44 +0000
committerRobert Kukla <roolku@rockbox.org>2009-07-26 19:51:44 +0000
commit00c657f9cc59cf0fdcd3ae2e9bc6e796b9aabf0e (patch)
treee2941bd4d22e7d1f9fb66729136a8d08d13897b0
parentc6309633a1b33c85b1920c61126ad03f262ab215 (diff)
downloadrockbox-00c657f9cc59cf0fdcd3ae2e9bc6e796b9aabf0e.zip
rockbox-00c657f9cc59cf0fdcd3ae2e9bc6e796b9aabf0e.tar.gz
rockbox-00c657f9cc59cf0fdcd3ae2e9bc6e796b9aabf0e.tar.bz2
rockbox-00c657f9cc59cf0fdcd3ae2e9bc6e796b9aabf0e.tar.xz
new powerup in brickmania
Author: Asael Reiter Flyspray: FS #10463 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22057 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugins/bitmaps/native/SOURCES20
-rw-r--r--apps/plugins/bitmaps/native/brickmania_long_pads.112x64x1.bmpbin0 -> 278 bytes
-rw-r--r--apps/plugins/bitmaps/native/brickmania_long_pads.132x80x16.bmpbin0 -> 1134 bytes
-rw-r--r--apps/plugins/bitmaps/native/brickmania_long_pads.160x128x16.bmpbin0 -> 1974 bytes
-rw-r--r--apps/plugins/bitmaps/native/brickmania_long_pads.160x128x2.bmpbin0 -> 430 bytes
-rw-r--r--apps/plugins/bitmaps/native/brickmania_long_pads.176x132x16.bmpbin0 -> 2574 bytes
-rw-r--r--apps/plugins/bitmaps/native/brickmania_long_pads.220x176x16.bmpbin0 -> 2574 bytes
-rw-r--r--apps/plugins/bitmaps/native/brickmania_long_pads.320x240x16.bmpbin0 -> 5010 bytes
-rw-r--r--apps/plugins/bitmaps/native/brickmania_long_pads.480x640x16.bmpbin0 -> 11446 bytes
-rw-r--r--apps/plugins/bitmaps/native/brickmania_long_pads.640x480x16.bmpbin0 -> 19878 bytes
-rw-r--r--apps/plugins/bitmaps/native/brickmania_powerups.112x64x1.bmpbin244 -> 282 bytes
-rw-r--r--apps/plugins/bitmaps/native/brickmania_powerups.132x80x16.bmpbin754 -> 954 bytes
-rw-r--r--apps/plugins/bitmaps/native/brickmania_powerups.160x128x16.bmpbin1400 -> 1782 bytes
-rw-r--r--apps/plugins/bitmaps/native/brickmania_powerups.160x128x2.bmpbin412 -> 506 bytes
-rw-r--r--apps/plugins/bitmaps/native/brickmania_powerups.176x132x16.bmpbin1400 -> 1782 bytes
-rw-r--r--apps/plugins/bitmaps/native/brickmania_powerups.220x176x16.bmpbin1400 -> 1782 bytes
-rw-r--r--apps/plugins/bitmaps/native/brickmania_powerups.320x240x16.bmpbin3416 -> 4374 bytes
-rw-r--r--apps/plugins/bitmaps/native/brickmania_powerups.480x640x16.bmpbin7614 -> 9774 bytes
-rw-r--r--apps/plugins/bitmaps/native/brickmania_powerups.640x480x16.bmpbin13494 -> 17334 bytes
-rw-r--r--apps/plugins/bitmaps/native/brickmania_short_pads.112x64x1.bmpbin0 -> 170 bytes
-rw-r--r--apps/plugins/bitmaps/native/brickmania_short_pads.132x80x16.bmpbin0 -> 522 bytes
-rw-r--r--apps/plugins/bitmaps/native/brickmania_short_pads.160x128x16.bmpbin0 -> 954 bytes
-rw-r--r--apps/plugins/bitmaps/native/brickmania_short_pads.160x128x2.bmpbin0 -> 298 bytes
-rw-r--r--apps/plugins/bitmaps/native/brickmania_short_pads.176x132x16.bmpbin0 -> 1314 bytes
-rw-r--r--apps/plugins/bitmaps/native/brickmania_short_pads.220x176x16.bmpbin0 -> 1314 bytes
-rw-r--r--apps/plugins/bitmaps/native/brickmania_short_pads.320x240x16.bmpbin0 -> 2574 bytes
-rw-r--r--apps/plugins/bitmaps/native/brickmania_short_pads.480x640x16.bmpbin0 -> 5814 bytes
-rw-r--r--apps/plugins/bitmaps/native/brickmania_short_pads.640x480x16.bmpbin0 -> 9966 bytes
-rw-r--r--apps/plugins/brickmania.c108
-rw-r--r--docs/CREDITS1
30 files changed, 91 insertions, 38 deletions
diff --git a/apps/plugins/bitmaps/native/SOURCES b/apps/plugins/bitmaps/native/SOURCES
index 176ad61..df93395 100644
--- a/apps/plugins/bitmaps/native/SOURCES
+++ b/apps/plugins/bitmaps/native/SOURCES
@@ -8,6 +8,8 @@ brickmania_gameover.112x54x16.bmp
brickmania_ball.15x15x16.bmp
brickmania_bricks.640x480x16.bmp
brickmania_pads.640x480x16.bmp
+brickmania_short_pads.640x480x16.bmp
+brickmania_long_pads.640x480x16.bmp
brickmania_break.640x480x16.bmp
brickmania_powerups.640x480x16.bmp
@@ -15,6 +17,8 @@ brickmania_powerups.640x480x16.bmp
brickmania_ball.11x11x16.bmp
brickmania_bricks.480x640x16.bmp
brickmania_pads.480x640x16.bmp
+brickmania_short_pads.480x640x16.bmp
+brickmania_long_pads.480x640x16.bmp
brickmania_break.480x640x16.bmp
brickmania_powerups.480x640x16.bmp
@@ -22,6 +26,8 @@ brickmania_powerups.480x640x16.bmp
brickmania_ball.5x5x16.bmp
brickmania_bricks.320x240x16.bmp
brickmania_pads.320x240x16.bmp
+brickmania_short_pads.320x240x16.bmp
+brickmania_long_pads.320x240x16.bmp
brickmania_break.320x240x16.bmp
brickmania_powerups.320x240x16.bmp
@@ -29,6 +35,8 @@ brickmania_powerups.320x240x16.bmp
brickmania_ball.5x5x16.bmp
brickmania_bricks.220x176x16.bmp
brickmania_pads.220x176x16.bmp
+brickmania_short_pads.220x176x16.bmp
+brickmania_long_pads.220x176x16.bmp
brickmania_break.220x176x16.bmp
brickmania_powerups.220x176x16.bmp
@@ -36,6 +44,8 @@ brickmania_powerups.220x176x16.bmp
brickmania_ball.5x5x16.bmp
brickmania_bricks.176x132x16.bmp
brickmania_pads.176x132x16.bmp
+brickmania_short_pads.176x132x16.bmp
+brickmania_long_pads.176x132x16.bmp
brickmania_powerups.176x132x16.bmp
brickmania_break.176x132x16.bmp
@@ -43,6 +53,8 @@ brickmania_break.176x132x16.bmp
brickmania_ball.5x5x16.bmp
brickmania_bricks.160x128x16.bmp
brickmania_pads.160x128x16.bmp
+brickmania_short_pads.160x128x16.bmp
+brickmania_long_pads.160x128x16.bmp
brickmania_powerups.160x128x16.bmp
brickmania_break.160x128x16.bmp
@@ -50,6 +62,8 @@ brickmania_break.160x128x16.bmp
brickmania_ball.4x4x16.bmp
brickmania_bricks.132x80x16.bmp
brickmania_pads.132x80x16.bmp
+brickmania_short_pads.132x80x16.bmp
+brickmania_long_pads.132x80x16.bmp
brickmania_powerups.132x80x16.bmp
brickmania_break.132x80x16.bmp
@@ -57,6 +71,8 @@ brickmania_break.132x80x16.bmp
brickmania_ball.4x4x16.bmp
brickmania_bricks.128x128x16.bmp
brickmania_pads.132x80x16.bmp
+brickmania_short_pads.132x80x16.bmp
+brickmania_long_pads.132x80x16.bmp
brickmania_powerups.132x80x16.bmp
brickmania_break.132x80x16.bmp
#endif /* different colour displays */
@@ -64,6 +80,8 @@ brickmania_break.132x80x16.bmp
#elif LCD_DEPTH > 1
brickmania_gameover.86x43x2.bmp
brickmania_pads.160x128x2.bmp
+brickmania_short_pads.160x128x2.bmp
+brickmania_long_pads.160x128x2.bmp
brickmania_powerups.160x128x2.bmp
#if (LCD_WIDTH >= 160)
brickmania_ball.5x5x2.bmp
@@ -80,6 +98,8 @@ brickmania_gameover.59x30x1.bmp
brickmania_bricks.112x64x1.bmp
brickmania_ball.3x3x1.bmp
brickmania_pads.112x64x1.bmp
+brickmania_short_pads.112x64x1.bmp
+brickmania_long_pads.112x64x1.bmp
brickmania_powerups.112x64x1.bmp
#endif
diff --git a/apps/plugins/bitmaps/native/brickmania_long_pads.112x64x1.bmp b/apps/plugins/bitmaps/native/brickmania_long_pads.112x64x1.bmp
new file mode 100644
index 0000000..4714e71
--- /dev/null
+++ b/apps/plugins/bitmaps/native/brickmania_long_pads.112x64x1.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_long_pads.132x80x16.bmp b/apps/plugins/bitmaps/native/brickmania_long_pads.132x80x16.bmp
new file mode 100644
index 0000000..8480c61
--- /dev/null
+++ b/apps/plugins/bitmaps/native/brickmania_long_pads.132x80x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_long_pads.160x128x16.bmp b/apps/plugins/bitmaps/native/brickmania_long_pads.160x128x16.bmp
new file mode 100644
index 0000000..3c994f7
--- /dev/null
+++ b/apps/plugins/bitmaps/native/brickmania_long_pads.160x128x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_long_pads.160x128x2.bmp b/apps/plugins/bitmaps/native/brickmania_long_pads.160x128x2.bmp
new file mode 100644
index 0000000..eee7ed8
--- /dev/null
+++ b/apps/plugins/bitmaps/native/brickmania_long_pads.160x128x2.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_long_pads.176x132x16.bmp b/apps/plugins/bitmaps/native/brickmania_long_pads.176x132x16.bmp
new file mode 100644
index 0000000..e1819db
--- /dev/null
+++ b/apps/plugins/bitmaps/native/brickmania_long_pads.176x132x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_long_pads.220x176x16.bmp b/apps/plugins/bitmaps/native/brickmania_long_pads.220x176x16.bmp
new file mode 100644
index 0000000..e1819db
--- /dev/null
+++ b/apps/plugins/bitmaps/native/brickmania_long_pads.220x176x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_long_pads.320x240x16.bmp b/apps/plugins/bitmaps/native/brickmania_long_pads.320x240x16.bmp
new file mode 100644
index 0000000..4b82df8
--- /dev/null
+++ b/apps/plugins/bitmaps/native/brickmania_long_pads.320x240x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_long_pads.480x640x16.bmp b/apps/plugins/bitmaps/native/brickmania_long_pads.480x640x16.bmp
new file mode 100644
index 0000000..fc1c12b
--- /dev/null
+++ b/apps/plugins/bitmaps/native/brickmania_long_pads.480x640x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_long_pads.640x480x16.bmp b/apps/plugins/bitmaps/native/brickmania_long_pads.640x480x16.bmp
new file mode 100644
index 0000000..b3b4707
--- /dev/null
+++ b/apps/plugins/bitmaps/native/brickmania_long_pads.640x480x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_powerups.112x64x1.bmp b/apps/plugins/bitmaps/native/brickmania_powerups.112x64x1.bmp
index 66cca0a..ecad786 100644
--- a/apps/plugins/bitmaps/native/brickmania_powerups.112x64x1.bmp
+++ b/apps/plugins/bitmaps/native/brickmania_powerups.112x64x1.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_powerups.132x80x16.bmp b/apps/plugins/bitmaps/native/brickmania_powerups.132x80x16.bmp
index 2ff913e..4e7b7ba 100644
--- a/apps/plugins/bitmaps/native/brickmania_powerups.132x80x16.bmp
+++ b/apps/plugins/bitmaps/native/brickmania_powerups.132x80x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_powerups.160x128x16.bmp b/apps/plugins/bitmaps/native/brickmania_powerups.160x128x16.bmp
index 91ece10..838d7a3 100644
--- a/apps/plugins/bitmaps/native/brickmania_powerups.160x128x16.bmp
+++ b/apps/plugins/bitmaps/native/brickmania_powerups.160x128x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_powerups.160x128x2.bmp b/apps/plugins/bitmaps/native/brickmania_powerups.160x128x2.bmp
index c52d534..8d83476 100644
--- a/apps/plugins/bitmaps/native/brickmania_powerups.160x128x2.bmp
+++ b/apps/plugins/bitmaps/native/brickmania_powerups.160x128x2.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_powerups.176x132x16.bmp b/apps/plugins/bitmaps/native/brickmania_powerups.176x132x16.bmp
index 91ece10..838d7a3 100644
--- a/apps/plugins/bitmaps/native/brickmania_powerups.176x132x16.bmp
+++ b/apps/plugins/bitmaps/native/brickmania_powerups.176x132x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_powerups.220x176x16.bmp b/apps/plugins/bitmaps/native/brickmania_powerups.220x176x16.bmp
index 91ece10..838d7a3 100644
--- a/apps/plugins/bitmaps/native/brickmania_powerups.220x176x16.bmp
+++ b/apps/plugins/bitmaps/native/brickmania_powerups.220x176x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_powerups.320x240x16.bmp b/apps/plugins/bitmaps/native/brickmania_powerups.320x240x16.bmp
index 6952b4d..d8e4028 100644
--- a/apps/plugins/bitmaps/native/brickmania_powerups.320x240x16.bmp
+++ b/apps/plugins/bitmaps/native/brickmania_powerups.320x240x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_powerups.480x640x16.bmp b/apps/plugins/bitmaps/native/brickmania_powerups.480x640x16.bmp
index eb7d1a4..4313f1f 100644
--- a/apps/plugins/bitmaps/native/brickmania_powerups.480x640x16.bmp
+++ b/apps/plugins/bitmaps/native/brickmania_powerups.480x640x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_powerups.640x480x16.bmp b/apps/plugins/bitmaps/native/brickmania_powerups.640x480x16.bmp
index 3fabfd2..1a58b5b 100644
--- a/apps/plugins/bitmaps/native/brickmania_powerups.640x480x16.bmp
+++ b/apps/plugins/bitmaps/native/brickmania_powerups.640x480x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_short_pads.112x64x1.bmp b/apps/plugins/bitmaps/native/brickmania_short_pads.112x64x1.bmp
new file mode 100644
index 0000000..a889517
--- /dev/null
+++ b/apps/plugins/bitmaps/native/brickmania_short_pads.112x64x1.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_short_pads.132x80x16.bmp b/apps/plugins/bitmaps/native/brickmania_short_pads.132x80x16.bmp
new file mode 100644
index 0000000..c5c13fc
--- /dev/null
+++ b/apps/plugins/bitmaps/native/brickmania_short_pads.132x80x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_short_pads.160x128x16.bmp b/apps/plugins/bitmaps/native/brickmania_short_pads.160x128x16.bmp
new file mode 100644
index 0000000..f750658
--- /dev/null
+++ b/apps/plugins/bitmaps/native/brickmania_short_pads.160x128x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_short_pads.160x128x2.bmp b/apps/plugins/bitmaps/native/brickmania_short_pads.160x128x2.bmp
new file mode 100644
index 0000000..45d1962
--- /dev/null
+++ b/apps/plugins/bitmaps/native/brickmania_short_pads.160x128x2.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_short_pads.176x132x16.bmp b/apps/plugins/bitmaps/native/brickmania_short_pads.176x132x16.bmp
new file mode 100644
index 0000000..022cfdd
--- /dev/null
+++ b/apps/plugins/bitmaps/native/brickmania_short_pads.176x132x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_short_pads.220x176x16.bmp b/apps/plugins/bitmaps/native/brickmania_short_pads.220x176x16.bmp
new file mode 100644
index 0000000..022cfdd
--- /dev/null
+++ b/apps/plugins/bitmaps/native/brickmania_short_pads.220x176x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_short_pads.320x240x16.bmp b/apps/plugins/bitmaps/native/brickmania_short_pads.320x240x16.bmp
new file mode 100644
index 0000000..b63ffc5
--- /dev/null
+++ b/apps/plugins/bitmaps/native/brickmania_short_pads.320x240x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_short_pads.480x640x16.bmp b/apps/plugins/bitmaps/native/brickmania_short_pads.480x640x16.bmp
new file mode 100644
index 0000000..76db3bb
--- /dev/null
+++ b/apps/plugins/bitmaps/native/brickmania_short_pads.480x640x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_short_pads.640x480x16.bmp b/apps/plugins/bitmaps/native/brickmania_short_pads.640x480x16.bmp
new file mode 100644
index 0000000..0b513e0
--- /dev/null
+++ b/apps/plugins/bitmaps/native/brickmania_short_pads.640x480x16.bmp
Binary files differ
diff --git a/apps/plugins/brickmania.c b/apps/plugins/brickmania.c
index 034ac9c..7f1b95b 100644
--- a/apps/plugins/brickmania.c
+++ b/apps/plugins/brickmania.c
@@ -214,6 +214,8 @@ CONFIG_KEYPAD == SANSA_M200_PAD
#endif
#include "pluginbitmaps/brickmania_pads.h"
+#include "pluginbitmaps/brickmania_short_pads.h"
+#include "pluginbitmaps/brickmania_long_pads.h"
#include "pluginbitmaps/brickmania_bricks.h"
#include "pluginbitmaps/brickmania_powerups.h"
#include "pluginbitmaps/brickmania_ball.h"
@@ -221,10 +223,12 @@ CONFIG_KEYPAD == SANSA_M200_PAD
#define PAD_WIDTH BMPWIDTH_brickmania_pads
#define PAD_HEIGHT (BMPHEIGHT_brickmania_pads/3)
+#define SHORT_PAD_WIDTH BMPWIDTH_brickmania_short_pads
+#define LONG_PAD_WIDTH BMPWIDTH_brickmania_long_pads
#define BRICK_HEIGHT (BMPHEIGHT_brickmania_bricks/7)
#define BRICK_WIDTH BMPWIDTH_brickmania_bricks
#define LEFTMARGIN ((LCD_WIDTH-10*BRICK_WIDTH)/2)
-#define POWERUP_HEIGHT (BMPHEIGHT_brickmania_powerups/7)
+#define POWERUP_HEIGHT (BMPHEIGHT_brickmania_powerups/9)
#define POWERUP_WIDTH BMPWIDTH_brickmania_powerups
#define BALL BMPHEIGHT_brickmania_ball
#define HALFBALL ((BALL+1)/2)
@@ -585,6 +589,7 @@ int used_balls=1;
bool saved_game=false;
int l_score=0;
int difficulty = EASY;
+int pad_width;
typedef struct cube {
int powertop;
@@ -642,7 +647,7 @@ static void brickmania_int_game(int new_game)
ball[i].tempy=0;
ball[i].tempx=0;
ball[i].pos_y=PAD_POS_Y-BALL;
- ball[i].pos_x=pad_pos_x+(PAD_WIDTH/2)-2;
+ ball[i].pos_x=LCD_WIDTH/2-2;
ball[i].glue=false;
}
@@ -650,7 +655,7 @@ static void brickmania_int_game(int new_game)
start_game =1;
con_game =0;
pad_type=0;
-
+ pad_width=PAD_WIDTH;
flip_sides=false;
if (new_game==1) {
@@ -1029,7 +1034,7 @@ static int brickmania_game_loop(void)
/* the bricks */
for (i=0;i<=7;i++) {
for (j=0;j<=9;j++) {
- if (brick[i*10+j].power<7) {
+ if (brick[i*10+j].power<9) {
if (brick[i*10+j].poweruse==2) {
if (con_game!=1)
brick[i*10+j].powertop+=2;
@@ -1047,7 +1052,7 @@ static int brickmania_game_loop(void)
}
if ((pad_pos_x<LEFTMARGIN+j*BRICK_WIDTH+5 &&
- pad_pos_x+PAD_WIDTH>LEFTMARGIN+j*BRICK_WIDTH+5) &&
+ pad_pos_x+pad_width>LEFTMARGIN+j*BRICK_WIDTH+5) &&
brick[i*10+j].powertop+6>=PAD_POS_Y &&
brick[i*10+j].poweruse==2) {
switch(brick[i*10+j].power) {
@@ -1078,6 +1083,8 @@ static int brickmania_game_loop(void)
for(k=0;k<used_balls;k++)
ball[k].glue=false;
flip_sides=false;
+ pad_pos_x+=(pad_width-PAD_WIDTH)/2;
+ pad_width=PAD_WIDTH;
break;
case 5:
score+=23;
@@ -1092,6 +1099,31 @@ static int brickmania_game_loop(void)
-1 : 1;
ball[used_balls-1].y= -4;
break;
+ case 7:
+ score+=23;
+ if (pad_width==PAD_WIDTH) {
+ pad_width=LONG_PAD_WIDTH;
+ pad_pos_x-=(LONG_PAD_WIDTH-PAD_WIDTH)/2;
+ }
+ else if (pad_width==SHORT_PAD_WIDTH) {
+ pad_width=PAD_WIDTH;
+ pad_pos_x-=(PAD_WIDTH-SHORT_PAD_WIDTH)/2;
+ }
+ if (pad_pos_x < 0)
+ pad_pos_x = 0;
+ else if(pad_pos_x+pad_width > LCD_WIDTH)
+ pad_pos_x = LCD_WIDTH-pad_width;
+ break;
+ case 8:
+ if (pad_width==PAD_WIDTH) {
+ pad_width=SHORT_PAD_WIDTH;
+ pad_pos_x+=(PAD_WIDTH-SHORT_PAD_WIDTH)/2;
+ }
+ else if (pad_width==LONG_PAD_WIDTH) {
+ pad_width=PAD_WIDTH;
+ pad_pos_x+=(LONG_PAD_WIDTH-PAD_WIDTH)/2;
+ }
+ break;
}
brick[i*10+j].poweruse=1;
}
@@ -1296,14 +1328,14 @@ static int brickmania_game_loop(void)
} /* for i */
/* draw the pad */
- rb->lcd_bitmap_part(brickmania_pads,0,pad_type*PAD_HEIGHT,
- PAD_WIDTH,pad_pos_x, PAD_POS_Y, PAD_WIDTH,
+ rb->lcd_bitmap_part(pad_width==PAD_WIDTH?brickmania_pads:pad_width==LONG_PAD_WIDTH?brickmania_long_pads:brickmania_short_pads,0,pad_type*PAD_HEIGHT,
+ pad_width,pad_pos_x, PAD_POS_Y, pad_width,
PAD_HEIGHT);
for(k=0;k<used_balls;k++) {
if ((ball[k].pos_x >= pad_pos_x &&
- ball[k].pos_x <= pad_pos_x+PAD_WIDTH) &&
+ ball[k].pos_x <= pad_pos_x+pad_width) &&
(PAD_POS_Y-4<ball[k].pos_y+BALL &&
PAD_POS_Y>ball[k].pos_y+BALL) && (ball[k].y >0))
ball[k].tempy=PAD_POS_Y-ball[k].pos_y-BALL;
@@ -1337,7 +1369,7 @@ static int brickmania_game_loop(void)
ball[used_balls].tempy=0;
ball[used_balls].tempx=0;
ball[used_balls].pos_y=PAD_POS_Y-BALL;
- ball[used_balls].pos_x=pad_pos_x+(PAD_WIDTH/2)-2;
+ ball[used_balls].pos_x=pad_pos_x+(pad_width/2)-2;
k--;
continue;
@@ -1359,65 +1391,65 @@ static int brickmania_game_loop(void)
if ((ball[k].pos_y+BALL >= PAD_POS_Y &&
(ball[k].pos_x >= pad_pos_x &&
- ball[k].pos_x <= pad_pos_x+PAD_WIDTH)) &&
+ ball[k].pos_x <= pad_pos_x+pad_width)) &&
start_game != 1 && !ball[k].glue) {
if ((ball[k].pos_x+HALFBALL >= pad_pos_x &&
ball[k].pos_x+HALFBALL <=
- pad_pos_x+(PAD_WIDTH/2/4)) ||
+ pad_pos_x+(pad_width/2/4)) ||
(ball[k].pos_x +HALFBALL>=
- pad_pos_x+(PAD_WIDTH-(PAD_WIDTH/2/4)) &&
- ball[k].pos_x+HALFBALL <= pad_pos_x+PAD_WIDTH)) {
+ pad_pos_x+(pad_width-(pad_width/2/4)) &&
+ ball[k].pos_x+HALFBALL <= pad_pos_x+pad_width)) {
ball[k].y = -2;
if (ball[k].pos_x != 0 &&
ball[k].pos_x+BALL!=LCD_WIDTH)
ball[k].x = brickmania_pad_check(6,0,ball[k].pos_x+2<=
- pad_pos_x+(PAD_WIDTH/2)?
+ pad_pos_x+(pad_width/2)?
0:1,k);
}
else if ((ball[k].pos_x+HALFBALL >=
- pad_pos_x+(PAD_WIDTH/2/4) &&
+ pad_pos_x+(pad_width/2/4) &&
ball[k].pos_x+HALFBALL <=
- pad_pos_x+2*(PAD_WIDTH/2/4)) ||
+ pad_pos_x+2*(pad_width/2/4)) ||
(ball[k].pos_x+HALFBALL >=
- pad_pos_x+(PAD_WIDTH-2*(PAD_WIDTH/2/4)) &&
+ pad_pos_x+(pad_width-2*(pad_width/2/4)) &&
ball[k].pos_x+HALFBALL <=
- pad_pos_x+(PAD_WIDTH-(PAD_WIDTH/2/4)) )) {
+ pad_pos_x+(pad_width-(pad_width/2/4)) )) {
ball[k].y = -3;
if (ball[k].pos_x != 0 &&
ball[k].pos_x+BALL!=LCD_WIDTH)
ball[k].x = brickmania_pad_check(4,0,ball[k].pos_x+2<=
- pad_pos_x+(PAD_WIDTH/2)?
+ pad_pos_x+(pad_width/2)?
0:1,k);
}
else if ((ball[k].pos_x+HALFBALL >=
- pad_pos_x+2*(PAD_WIDTH/2/4) &&
+ pad_pos_x+2*(pad_width/2/4) &&
ball[k].pos_x+HALFBALL <=
- pad_pos_x+3*(PAD_WIDTH/2/4)) ||
+ pad_pos_x+3*(pad_width/2/4)) ||
(ball[k].pos_x+2 >=
- pad_pos_x+(PAD_WIDTH-3*(PAD_WIDTH/2/4)) &&
+ pad_pos_x+(pad_width-3*(pad_width/2/4)) &&
ball[k].pos_x+2 <=
- pad_pos_x+ ((PAD_WIDTH/2)-2*(PAD_WIDTH/2/4)) )) {
+ pad_pos_x+ ((pad_width/2)-2*(pad_width/2/4)) )) {
ball[k].y = -4;
if (ball[k].pos_x != 0 &&
ball[k].pos_x+BALL!=LCD_WIDTH)
ball[k].x = brickmania_pad_check(3,0,ball[k].pos_x+2<=
- pad_pos_x+(PAD_WIDTH/2)?
+ pad_pos_x+(pad_width/2)?
0:1,k);
}
else if ((ball[k].pos_x+HALFBALL >=
- pad_pos_x+3*(PAD_WIDTH/2/4) &&
+ pad_pos_x+3*(pad_width/2/4) &&
ball[k].pos_x+HALFBALL <=
- pad_pos_x+4*(PAD_WIDTH/2/4)-2) ||
- (ball[k].pos_x+2 >= pad_pos_x+(PAD_WIDTH/2+2) &&
+ pad_pos_x+4*(pad_width/2/4)-2) ||
+ (ball[k].pos_x+2 >= pad_pos_x+(pad_width/2+2) &&
ball[k].pos_x+2 <=
- pad_pos_x+(PAD_WIDTH-3*(PAD_WIDTH/2/4)) )) {
+ pad_pos_x+(pad_width-3*(pad_width/2/4)) )) {
ball[k].y = -4;
if (ball[k].pos_x != 0 &&
@@ -1441,7 +1473,7 @@ static int brickmania_game_loop(void)
if (ball[k].pos_y+5 >= PAD_POS_Y &&
(pad_type==1 && !ball[k].glue) &&
(ball[k].pos_x >= pad_pos_x &&
- ball[k].pos_x <= pad_pos_x+PAD_WIDTH)) {
+ ball[k].pos_x <= pad_pos_x+pad_width)) {
ball[k].y=0;
ball[k].pos_y=PAD_POS_Y-BALL;
ball[k].glue=true;
@@ -1511,15 +1543,15 @@ static int brickmania_game_loop(void)
touch_y = rb->button_get_data() & 0xffff;
if(touch_y >= PAD_POS_Y && touch_y <= PAD_POS_Y+PAD_HEIGHT)
{
- pad_pos_x += (flip_sides ? -1 : 1) * ( (touch_x-pad_pos_x-PAD_WIDTH/2) / 4 );
+ pad_pos_x += (flip_sides ? -1 : 1) * ( (touch_x-pad_pos_x-pad_width/2) / 4 );
if(pad_pos_x < 0)
pad_pos_x = 0;
- else if(pad_pos_x+PAD_WIDTH > LCD_WIDTH)
- pad_pos_x = LCD_WIDTH-PAD_WIDTH;
+ else if(pad_pos_x+pad_width > LCD_WIDTH)
+ pad_pos_x = LCD_WIDTH-pad_width;
for(k=0;k<used_balls;k++)
if ((start_game==1 || ball[k].glue))
- ball[k].pos_x = pad_pos_x+PAD_WIDTH/2;
+ ball[k].pos_x = pad_pos_x+pad_width/2;
}
if(button & BUTTON_REL)
@@ -1540,11 +1572,11 @@ static int brickmania_game_loop(void)
continue;
if ((button_right && flip_sides==false) ||
(button_left && flip_sides==true)) {
- if (pad_pos_x+8+PAD_WIDTH > LCD_WIDTH) {
+ if (pad_pos_x+8+pad_width > LCD_WIDTH) {
for(k=0;k<used_balls;k++)
if (start_game==1 || ball[k].glue)
- ball[k].pos_x+=LCD_WIDTH-pad_pos_x-PAD_WIDTH;
- pad_pos_x+=LCD_WIDTH-pad_pos_x-PAD_WIDTH;
+ ball[k].pos_x+=LCD_WIDTH-pad_pos_x-pad_width;
+ pad_pos_x+=LCD_WIDTH-pad_pos_x-pad_width;
}
else {
for(k=0;k<used_balls;k++)
@@ -1579,7 +1611,7 @@ static int brickmania_game_loop(void)
if (start_game==1 && con_game!=1 && pad_type!=1) {
for(k=0;k<used_balls;k++) {
ball[k].y=-4;
- ball[k].x=pad_pos_x+(PAD_WIDTH/2)-2>=
+ ball[k].x=pad_pos_x+(pad_width/2)-2>=
LCD_WIDTH/2?2:-2;
}
start_game =0;
@@ -1605,7 +1637,7 @@ static int brickmania_game_loop(void)
fire[tfire].left=pad_pos_x+1;
tfire=brickmania_fire_space();
fire[tfire].top=PAD_POS_Y-7;
- fire[tfire].left=pad_pos_x+PAD_WIDTH-1;
+ fire[tfire].left=pad_pos_x+pad_width-1;
} else if (con_game==1 && start_game!=1) {
for(k=0;k<used_balls;k++) {
ball[k].x=x[k];
diff --git a/docs/CREDITS b/docs/CREDITS
index 9527a73..b5f6bfc 100644
--- a/docs/CREDITS
+++ b/docs/CREDITS
@@ -483,6 +483,7 @@ David Johnston
Ralph Soto
Mykhailo Radzievskyi
Christophe Gouiran
+Asael Reiter
The libmad team
The wavpack team