From 00c657f9cc59cf0fdcd3ae2e9bc6e796b9aabf0e Mon Sep 17 00:00:00 2001 From: Robert Kukla Date: Sun, 26 Jul 2009 19:51:44 +0000 Subject: 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 --- apps/plugins/bitmaps/native/SOURCES | 20 ++++ .../native/brickmania_long_pads.112x64x1.bmp | Bin 0 -> 278 bytes .../native/brickmania_long_pads.132x80x16.bmp | Bin 0 -> 1134 bytes .../native/brickmania_long_pads.160x128x16.bmp | Bin 0 -> 1974 bytes .../native/brickmania_long_pads.160x128x2.bmp | Bin 0 -> 430 bytes .../native/brickmania_long_pads.176x132x16.bmp | Bin 0 -> 2574 bytes .../native/brickmania_long_pads.220x176x16.bmp | Bin 0 -> 2574 bytes .../native/brickmania_long_pads.320x240x16.bmp | Bin 0 -> 5010 bytes .../native/brickmania_long_pads.480x640x16.bmp | Bin 0 -> 11446 bytes .../native/brickmania_long_pads.640x480x16.bmp | Bin 0 -> 19878 bytes .../native/brickmania_powerups.112x64x1.bmp | Bin 244 -> 282 bytes .../native/brickmania_powerups.132x80x16.bmp | Bin 754 -> 954 bytes .../native/brickmania_powerups.160x128x16.bmp | Bin 1400 -> 1782 bytes .../native/brickmania_powerups.160x128x2.bmp | Bin 412 -> 506 bytes .../native/brickmania_powerups.176x132x16.bmp | Bin 1400 -> 1782 bytes .../native/brickmania_powerups.220x176x16.bmp | Bin 1400 -> 1782 bytes .../native/brickmania_powerups.320x240x16.bmp | Bin 3416 -> 4374 bytes .../native/brickmania_powerups.480x640x16.bmp | Bin 7614 -> 9774 bytes .../native/brickmania_powerups.640x480x16.bmp | Bin 13494 -> 17334 bytes .../native/brickmania_short_pads.112x64x1.bmp | Bin 0 -> 170 bytes .../native/brickmania_short_pads.132x80x16.bmp | Bin 0 -> 522 bytes .../native/brickmania_short_pads.160x128x16.bmp | Bin 0 -> 954 bytes .../native/brickmania_short_pads.160x128x2.bmp | Bin 0 -> 298 bytes .../native/brickmania_short_pads.176x132x16.bmp | Bin 0 -> 1314 bytes .../native/brickmania_short_pads.220x176x16.bmp | Bin 0 -> 1314 bytes .../native/brickmania_short_pads.320x240x16.bmp | Bin 0 -> 2574 bytes .../native/brickmania_short_pads.480x640x16.bmp | Bin 0 -> 5814 bytes .../native/brickmania_short_pads.640x480x16.bmp | Bin 0 -> 9966 bytes apps/plugins/brickmania.c | 108 +++++++++++++-------- docs/CREDITS | 1 + 30 files changed, 91 insertions(+), 38 deletions(-) create mode 100644 apps/plugins/bitmaps/native/brickmania_long_pads.112x64x1.bmp create mode 100644 apps/plugins/bitmaps/native/brickmania_long_pads.132x80x16.bmp create mode 100644 apps/plugins/bitmaps/native/brickmania_long_pads.160x128x16.bmp create mode 100644 apps/plugins/bitmaps/native/brickmania_long_pads.160x128x2.bmp create mode 100644 apps/plugins/bitmaps/native/brickmania_long_pads.176x132x16.bmp create mode 100644 apps/plugins/bitmaps/native/brickmania_long_pads.220x176x16.bmp create mode 100644 apps/plugins/bitmaps/native/brickmania_long_pads.320x240x16.bmp create mode 100644 apps/plugins/bitmaps/native/brickmania_long_pads.480x640x16.bmp create mode 100644 apps/plugins/bitmaps/native/brickmania_long_pads.640x480x16.bmp create mode 100644 apps/plugins/bitmaps/native/brickmania_short_pads.112x64x1.bmp create mode 100644 apps/plugins/bitmaps/native/brickmania_short_pads.132x80x16.bmp create mode 100644 apps/plugins/bitmaps/native/brickmania_short_pads.160x128x16.bmp create mode 100644 apps/plugins/bitmaps/native/brickmania_short_pads.160x128x2.bmp create mode 100644 apps/plugins/bitmaps/native/brickmania_short_pads.176x132x16.bmp create mode 100644 apps/plugins/bitmaps/native/brickmania_short_pads.220x176x16.bmp create mode 100644 apps/plugins/bitmaps/native/brickmania_short_pads.320x240x16.bmp create mode 100644 apps/plugins/bitmaps/native/brickmania_short_pads.480x640x16.bmp create mode 100644 apps/plugins/bitmaps/native/brickmania_short_pads.640x480x16.bmp diff --git a/apps/plugins/bitmaps/native/SOURCES b/apps/plugins/bitmaps/native/SOURCES index 176ad61d82..df93395ee1 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 0000000000..4714e711b1 Binary files /dev/null and b/apps/plugins/bitmaps/native/brickmania_long_pads.112x64x1.bmp 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 0000000000..8480c612b8 Binary files /dev/null and b/apps/plugins/bitmaps/native/brickmania_long_pads.132x80x16.bmp 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 0000000000..3c994f76cb Binary files /dev/null and b/apps/plugins/bitmaps/native/brickmania_long_pads.160x128x16.bmp 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 0000000000..eee7ed8adc Binary files /dev/null and b/apps/plugins/bitmaps/native/brickmania_long_pads.160x128x2.bmp 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 0000000000..e1819db343 Binary files /dev/null and b/apps/plugins/bitmaps/native/brickmania_long_pads.176x132x16.bmp 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 0000000000..e1819db343 Binary files /dev/null and b/apps/plugins/bitmaps/native/brickmania_long_pads.220x176x16.bmp 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 0000000000..4b82df8ac6 Binary files /dev/null and b/apps/plugins/bitmaps/native/brickmania_long_pads.320x240x16.bmp 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 0000000000..fc1c12b0ab Binary files /dev/null and b/apps/plugins/bitmaps/native/brickmania_long_pads.480x640x16.bmp 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 0000000000..b3b470750a Binary files /dev/null and b/apps/plugins/bitmaps/native/brickmania_long_pads.640x480x16.bmp differ diff --git a/apps/plugins/bitmaps/native/brickmania_powerups.112x64x1.bmp b/apps/plugins/bitmaps/native/brickmania_powerups.112x64x1.bmp index 66cca0a6d8..ecad786393 100644 Binary files a/apps/plugins/bitmaps/native/brickmania_powerups.112x64x1.bmp and b/apps/plugins/bitmaps/native/brickmania_powerups.112x64x1.bmp differ diff --git a/apps/plugins/bitmaps/native/brickmania_powerups.132x80x16.bmp b/apps/plugins/bitmaps/native/brickmania_powerups.132x80x16.bmp index 2ff913e3a3..4e7b7ba235 100644 Binary files a/apps/plugins/bitmaps/native/brickmania_powerups.132x80x16.bmp and b/apps/plugins/bitmaps/native/brickmania_powerups.132x80x16.bmp differ diff --git a/apps/plugins/bitmaps/native/brickmania_powerups.160x128x16.bmp b/apps/plugins/bitmaps/native/brickmania_powerups.160x128x16.bmp index 91ece1048d..838d7a3031 100644 Binary files a/apps/plugins/bitmaps/native/brickmania_powerups.160x128x16.bmp and b/apps/plugins/bitmaps/native/brickmania_powerups.160x128x16.bmp differ diff --git a/apps/plugins/bitmaps/native/brickmania_powerups.160x128x2.bmp b/apps/plugins/bitmaps/native/brickmania_powerups.160x128x2.bmp index c52d5348c8..8d834766d3 100644 Binary files a/apps/plugins/bitmaps/native/brickmania_powerups.160x128x2.bmp and b/apps/plugins/bitmaps/native/brickmania_powerups.160x128x2.bmp differ diff --git a/apps/plugins/bitmaps/native/brickmania_powerups.176x132x16.bmp b/apps/plugins/bitmaps/native/brickmania_powerups.176x132x16.bmp index 91ece1048d..838d7a3031 100644 Binary files a/apps/plugins/bitmaps/native/brickmania_powerups.176x132x16.bmp and b/apps/plugins/bitmaps/native/brickmania_powerups.176x132x16.bmp differ diff --git a/apps/plugins/bitmaps/native/brickmania_powerups.220x176x16.bmp b/apps/plugins/bitmaps/native/brickmania_powerups.220x176x16.bmp index 91ece1048d..838d7a3031 100644 Binary files a/apps/plugins/bitmaps/native/brickmania_powerups.220x176x16.bmp and b/apps/plugins/bitmaps/native/brickmania_powerups.220x176x16.bmp differ diff --git a/apps/plugins/bitmaps/native/brickmania_powerups.320x240x16.bmp b/apps/plugins/bitmaps/native/brickmania_powerups.320x240x16.bmp index 6952b4dea8..d8e40280e0 100644 Binary files a/apps/plugins/bitmaps/native/brickmania_powerups.320x240x16.bmp and b/apps/plugins/bitmaps/native/brickmania_powerups.320x240x16.bmp differ diff --git a/apps/plugins/bitmaps/native/brickmania_powerups.480x640x16.bmp b/apps/plugins/bitmaps/native/brickmania_powerups.480x640x16.bmp index eb7d1a4402..4313f1fe0f 100644 Binary files a/apps/plugins/bitmaps/native/brickmania_powerups.480x640x16.bmp and b/apps/plugins/bitmaps/native/brickmania_powerups.480x640x16.bmp differ diff --git a/apps/plugins/bitmaps/native/brickmania_powerups.640x480x16.bmp b/apps/plugins/bitmaps/native/brickmania_powerups.640x480x16.bmp index 3fabfd2bb5..1a58b5bae5 100644 Binary files a/apps/plugins/bitmaps/native/brickmania_powerups.640x480x16.bmp and b/apps/plugins/bitmaps/native/brickmania_powerups.640x480x16.bmp 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 0000000000..a889517eaa Binary files /dev/null and b/apps/plugins/bitmaps/native/brickmania_short_pads.112x64x1.bmp 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 0000000000..c5c13fc842 Binary files /dev/null and b/apps/plugins/bitmaps/native/brickmania_short_pads.132x80x16.bmp 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 0000000000..f750658479 Binary files /dev/null and b/apps/plugins/bitmaps/native/brickmania_short_pads.160x128x16.bmp 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 0000000000..45d1962d96 Binary files /dev/null and b/apps/plugins/bitmaps/native/brickmania_short_pads.160x128x2.bmp 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 0000000000..022cfddc0d Binary files /dev/null and b/apps/plugins/bitmaps/native/brickmania_short_pads.176x132x16.bmp 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 0000000000..022cfddc0d Binary files /dev/null and b/apps/plugins/bitmaps/native/brickmania_short_pads.220x176x16.bmp 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 0000000000..b63ffc5f7f Binary files /dev/null and b/apps/plugins/bitmaps/native/brickmania_short_pads.320x240x16.bmp 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 0000000000..76db3bb73a Binary files /dev/null and b/apps/plugins/bitmaps/native/brickmania_short_pads.480x640x16.bmp 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 0000000000..0b513e0c95 Binary files /dev/null and b/apps/plugins/bitmaps/native/brickmania_short_pads.640x480x16.bmp differ diff --git a/apps/plugins/brickmania.c b/apps/plugins/brickmania.c index 034ac9c770..7f1b95b6cd 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_xLEFTMARGIN+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 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= pad_pos_x && - ball[k].pos_x <= pad_pos_x+PAD_WIDTH) && + ball[k].pos_x <= pad_pos_x+pad_width) && (PAD_POS_Y-4ball[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 LCD_WIDTH) { + if (pad_pos_x+8+pad_width > LCD_WIDTH) { for(k=0;k= + 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