A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd

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

+91 -38
+20
apps/plugins/bitmaps/native/SOURCES
··· 8 8 brickmania_ball.15x15x16.bmp 9 9 brickmania_bricks.640x480x16.bmp 10 10 brickmania_pads.640x480x16.bmp 11 + brickmania_short_pads.640x480x16.bmp 12 + brickmania_long_pads.640x480x16.bmp 11 13 brickmania_break.640x480x16.bmp 12 14 brickmania_powerups.640x480x16.bmp 13 15 ··· 15 17 brickmania_ball.11x11x16.bmp 16 18 brickmania_bricks.480x640x16.bmp 17 19 brickmania_pads.480x640x16.bmp 20 + brickmania_short_pads.480x640x16.bmp 21 + brickmania_long_pads.480x640x16.bmp 18 22 brickmania_break.480x640x16.bmp 19 23 brickmania_powerups.480x640x16.bmp 20 24 ··· 22 26 brickmania_ball.5x5x16.bmp 23 27 brickmania_bricks.320x240x16.bmp 24 28 brickmania_pads.320x240x16.bmp 29 + brickmania_short_pads.320x240x16.bmp 30 + brickmania_long_pads.320x240x16.bmp 25 31 brickmania_break.320x240x16.bmp 26 32 brickmania_powerups.320x240x16.bmp 27 33 ··· 29 35 brickmania_ball.5x5x16.bmp 30 36 brickmania_bricks.220x176x16.bmp 31 37 brickmania_pads.220x176x16.bmp 38 + brickmania_short_pads.220x176x16.bmp 39 + brickmania_long_pads.220x176x16.bmp 32 40 brickmania_break.220x176x16.bmp 33 41 brickmania_powerups.220x176x16.bmp 34 42 ··· 36 44 brickmania_ball.5x5x16.bmp 37 45 brickmania_bricks.176x132x16.bmp 38 46 brickmania_pads.176x132x16.bmp 47 + brickmania_short_pads.176x132x16.bmp 48 + brickmania_long_pads.176x132x16.bmp 39 49 brickmania_powerups.176x132x16.bmp 40 50 brickmania_break.176x132x16.bmp 41 51 ··· 43 53 brickmania_ball.5x5x16.bmp 44 54 brickmania_bricks.160x128x16.bmp 45 55 brickmania_pads.160x128x16.bmp 56 + brickmania_short_pads.160x128x16.bmp 57 + brickmania_long_pads.160x128x16.bmp 46 58 brickmania_powerups.160x128x16.bmp 47 59 brickmania_break.160x128x16.bmp 48 60 ··· 50 62 brickmania_ball.4x4x16.bmp 51 63 brickmania_bricks.132x80x16.bmp 52 64 brickmania_pads.132x80x16.bmp 65 + brickmania_short_pads.132x80x16.bmp 66 + brickmania_long_pads.132x80x16.bmp 53 67 brickmania_powerups.132x80x16.bmp 54 68 brickmania_break.132x80x16.bmp 55 69 ··· 57 71 brickmania_ball.4x4x16.bmp 58 72 brickmania_bricks.128x128x16.bmp 59 73 brickmania_pads.132x80x16.bmp 74 + brickmania_short_pads.132x80x16.bmp 75 + brickmania_long_pads.132x80x16.bmp 60 76 brickmania_powerups.132x80x16.bmp 61 77 brickmania_break.132x80x16.bmp 62 78 #endif /* different colour displays */ ··· 64 80 #elif LCD_DEPTH > 1 65 81 brickmania_gameover.86x43x2.bmp 66 82 brickmania_pads.160x128x2.bmp 83 + brickmania_short_pads.160x128x2.bmp 84 + brickmania_long_pads.160x128x2.bmp 67 85 brickmania_powerups.160x128x2.bmp 68 86 #if (LCD_WIDTH >= 160) 69 87 brickmania_ball.5x5x2.bmp ··· 80 98 brickmania_bricks.112x64x1.bmp 81 99 brickmania_ball.3x3x1.bmp 82 100 brickmania_pads.112x64x1.bmp 101 + brickmania_short_pads.112x64x1.bmp 102 + brickmania_long_pads.112x64x1.bmp 83 103 brickmania_powerups.112x64x1.bmp 84 104 #endif 85 105
apps/plugins/bitmaps/native/brickmania_long_pads.112x64x1.bmp

This is a binary file and will not be displayed.

apps/plugins/bitmaps/native/brickmania_long_pads.132x80x16.bmp

This is a binary file and will not be displayed.

apps/plugins/bitmaps/native/brickmania_long_pads.160x128x16.bmp

This is a binary file and will not be displayed.

apps/plugins/bitmaps/native/brickmania_long_pads.160x128x2.bmp

This is a binary file and will not be displayed.

apps/plugins/bitmaps/native/brickmania_long_pads.176x132x16.bmp

This is a binary file and will not be displayed.

apps/plugins/bitmaps/native/brickmania_long_pads.220x176x16.bmp

This is a binary file and will not be displayed.

apps/plugins/bitmaps/native/brickmania_long_pads.320x240x16.bmp

This is a binary file and will not be displayed.

apps/plugins/bitmaps/native/brickmania_long_pads.480x640x16.bmp

This is a binary file and will not be displayed.

apps/plugins/bitmaps/native/brickmania_long_pads.640x480x16.bmp

This is a binary file and will not be displayed.

apps/plugins/bitmaps/native/brickmania_powerups.112x64x1.bmp

This is a binary file and will not be displayed.

apps/plugins/bitmaps/native/brickmania_powerups.132x80x16.bmp

This is a binary file and will not be displayed.

apps/plugins/bitmaps/native/brickmania_powerups.160x128x16.bmp

This is a binary file and will not be displayed.

apps/plugins/bitmaps/native/brickmania_powerups.160x128x2.bmp

This is a binary file and will not be displayed.

apps/plugins/bitmaps/native/brickmania_powerups.176x132x16.bmp

This is a binary file and will not be displayed.

apps/plugins/bitmaps/native/brickmania_powerups.220x176x16.bmp

This is a binary file and will not be displayed.

apps/plugins/bitmaps/native/brickmania_powerups.320x240x16.bmp

This is a binary file and will not be displayed.

apps/plugins/bitmaps/native/brickmania_powerups.480x640x16.bmp

This is a binary file and will not be displayed.

apps/plugins/bitmaps/native/brickmania_powerups.640x480x16.bmp

This is a binary file and will not be displayed.

apps/plugins/bitmaps/native/brickmania_short_pads.112x64x1.bmp

This is a binary file and will not be displayed.

apps/plugins/bitmaps/native/brickmania_short_pads.132x80x16.bmp

This is a binary file and will not be displayed.

apps/plugins/bitmaps/native/brickmania_short_pads.160x128x16.bmp

This is a binary file and will not be displayed.

apps/plugins/bitmaps/native/brickmania_short_pads.160x128x2.bmp

This is a binary file and will not be displayed.

apps/plugins/bitmaps/native/brickmania_short_pads.176x132x16.bmp

This is a binary file and will not be displayed.

apps/plugins/bitmaps/native/brickmania_short_pads.220x176x16.bmp

This is a binary file and will not be displayed.

apps/plugins/bitmaps/native/brickmania_short_pads.320x240x16.bmp

This is a binary file and will not be displayed.

apps/plugins/bitmaps/native/brickmania_short_pads.480x640x16.bmp

This is a binary file and will not be displayed.

apps/plugins/bitmaps/native/brickmania_short_pads.640x480x16.bmp

This is a binary file and will not be displayed.

+70 -38
apps/plugins/brickmania.c
··· 214 214 #endif 215 215 216 216 #include "pluginbitmaps/brickmania_pads.h" 217 + #include "pluginbitmaps/brickmania_short_pads.h" 218 + #include "pluginbitmaps/brickmania_long_pads.h" 217 219 #include "pluginbitmaps/brickmania_bricks.h" 218 220 #include "pluginbitmaps/brickmania_powerups.h" 219 221 #include "pluginbitmaps/brickmania_ball.h" ··· 221 223 222 224 #define PAD_WIDTH BMPWIDTH_brickmania_pads 223 225 #define PAD_HEIGHT (BMPHEIGHT_brickmania_pads/3) 226 + #define SHORT_PAD_WIDTH BMPWIDTH_brickmania_short_pads 227 + #define LONG_PAD_WIDTH BMPWIDTH_brickmania_long_pads 224 228 #define BRICK_HEIGHT (BMPHEIGHT_brickmania_bricks/7) 225 229 #define BRICK_WIDTH BMPWIDTH_brickmania_bricks 226 230 #define LEFTMARGIN ((LCD_WIDTH-10*BRICK_WIDTH)/2) 227 - #define POWERUP_HEIGHT (BMPHEIGHT_brickmania_powerups/7) 231 + #define POWERUP_HEIGHT (BMPHEIGHT_brickmania_powerups/9) 228 232 #define POWERUP_WIDTH BMPWIDTH_brickmania_powerups 229 233 #define BALL BMPHEIGHT_brickmania_ball 230 234 #define HALFBALL ((BALL+1)/2) ··· 585 589 bool saved_game=false; 586 590 int l_score=0; 587 591 int difficulty = EASY; 592 + int pad_width; 588 593 589 594 typedef struct cube { 590 595 int powertop; ··· 642 647 ball[i].tempy=0; 643 648 ball[i].tempx=0; 644 649 ball[i].pos_y=PAD_POS_Y-BALL; 645 - ball[i].pos_x=pad_pos_x+(PAD_WIDTH/2)-2; 650 + ball[i].pos_x=LCD_WIDTH/2-2; 646 651 ball[i].glue=false; 647 652 } 648 653 ··· 650 655 start_game =1; 651 656 con_game =0; 652 657 pad_type=0; 653 - 658 + pad_width=PAD_WIDTH; 654 659 flip_sides=false; 655 660 656 661 if (new_game==1) { ··· 1029 1034 /* the bricks */ 1030 1035 for (i=0;i<=7;i++) { 1031 1036 for (j=0;j<=9;j++) { 1032 - if (brick[i*10+j].power<7) { 1037 + if (brick[i*10+j].power<9) { 1033 1038 if (brick[i*10+j].poweruse==2) { 1034 1039 if (con_game!=1) 1035 1040 brick[i*10+j].powertop+=2; ··· 1047 1052 } 1048 1053 1049 1054 if ((pad_pos_x<LEFTMARGIN+j*BRICK_WIDTH+5 && 1050 - pad_pos_x+PAD_WIDTH>LEFTMARGIN+j*BRICK_WIDTH+5) && 1055 + pad_pos_x+pad_width>LEFTMARGIN+j*BRICK_WIDTH+5) && 1051 1056 brick[i*10+j].powertop+6>=PAD_POS_Y && 1052 1057 brick[i*10+j].poweruse==2) { 1053 1058 switch(brick[i*10+j].power) { ··· 1078 1083 for(k=0;k<used_balls;k++) 1079 1084 ball[k].glue=false; 1080 1085 flip_sides=false; 1086 + pad_pos_x+=(pad_width-PAD_WIDTH)/2; 1087 + pad_width=PAD_WIDTH; 1081 1088 break; 1082 1089 case 5: 1083 1090 score+=23; ··· 1092 1099 -1 : 1; 1093 1100 ball[used_balls-1].y= -4; 1094 1101 break; 1102 + case 7: 1103 + score+=23; 1104 + if (pad_width==PAD_WIDTH) { 1105 + pad_width=LONG_PAD_WIDTH; 1106 + pad_pos_x-=(LONG_PAD_WIDTH-PAD_WIDTH)/2; 1107 + } 1108 + else if (pad_width==SHORT_PAD_WIDTH) { 1109 + pad_width=PAD_WIDTH; 1110 + pad_pos_x-=(PAD_WIDTH-SHORT_PAD_WIDTH)/2; 1111 + } 1112 + if (pad_pos_x < 0) 1113 + pad_pos_x = 0; 1114 + else if(pad_pos_x+pad_width > LCD_WIDTH) 1115 + pad_pos_x = LCD_WIDTH-pad_width; 1116 + break; 1117 + case 8: 1118 + if (pad_width==PAD_WIDTH) { 1119 + pad_width=SHORT_PAD_WIDTH; 1120 + pad_pos_x+=(PAD_WIDTH-SHORT_PAD_WIDTH)/2; 1121 + } 1122 + else if (pad_width==LONG_PAD_WIDTH) { 1123 + pad_width=PAD_WIDTH; 1124 + pad_pos_x+=(LONG_PAD_WIDTH-PAD_WIDTH)/2; 1125 + } 1126 + break; 1095 1127 } 1096 1128 brick[i*10+j].poweruse=1; 1097 1129 } ··· 1296 1328 } /* for i */ 1297 1329 1298 1330 /* draw the pad */ 1299 - rb->lcd_bitmap_part(brickmania_pads,0,pad_type*PAD_HEIGHT, 1300 - PAD_WIDTH,pad_pos_x, PAD_POS_Y, PAD_WIDTH, 1331 + 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, 1332 + pad_width,pad_pos_x, PAD_POS_Y, pad_width, 1301 1333 PAD_HEIGHT); 1302 1334 1303 1335 for(k=0;k<used_balls;k++) { 1304 1336 1305 1337 if ((ball[k].pos_x >= pad_pos_x && 1306 - ball[k].pos_x <= pad_pos_x+PAD_WIDTH) && 1338 + ball[k].pos_x <= pad_pos_x+pad_width) && 1307 1339 (PAD_POS_Y-4<ball[k].pos_y+BALL && 1308 1340 PAD_POS_Y>ball[k].pos_y+BALL) && (ball[k].y >0)) 1309 1341 ball[k].tempy=PAD_POS_Y-ball[k].pos_y-BALL; ··· 1337 1369 ball[used_balls].tempy=0; 1338 1370 ball[used_balls].tempx=0; 1339 1371 ball[used_balls].pos_y=PAD_POS_Y-BALL; 1340 - ball[used_balls].pos_x=pad_pos_x+(PAD_WIDTH/2)-2; 1372 + ball[used_balls].pos_x=pad_pos_x+(pad_width/2)-2; 1341 1373 1342 1374 k--; 1343 1375 continue; ··· 1359 1391 1360 1392 if ((ball[k].pos_y+BALL >= PAD_POS_Y && 1361 1393 (ball[k].pos_x >= pad_pos_x && 1362 - ball[k].pos_x <= pad_pos_x+PAD_WIDTH)) && 1394 + ball[k].pos_x <= pad_pos_x+pad_width)) && 1363 1395 start_game != 1 && !ball[k].glue) { 1364 1396 1365 1397 if ((ball[k].pos_x+HALFBALL >= pad_pos_x && 1366 1398 ball[k].pos_x+HALFBALL <= 1367 - pad_pos_x+(PAD_WIDTH/2/4)) || 1399 + pad_pos_x+(pad_width/2/4)) || 1368 1400 (ball[k].pos_x +HALFBALL>= 1369 - pad_pos_x+(PAD_WIDTH-(PAD_WIDTH/2/4)) && 1370 - ball[k].pos_x+HALFBALL <= pad_pos_x+PAD_WIDTH)) { 1401 + pad_pos_x+(pad_width-(pad_width/2/4)) && 1402 + ball[k].pos_x+HALFBALL <= pad_pos_x+pad_width)) { 1371 1403 1372 1404 ball[k].y = -2; 1373 1405 if (ball[k].pos_x != 0 && 1374 1406 ball[k].pos_x+BALL!=LCD_WIDTH) 1375 1407 ball[k].x = brickmania_pad_check(6,0,ball[k].pos_x+2<= 1376 - pad_pos_x+(PAD_WIDTH/2)? 1408 + pad_pos_x+(pad_width/2)? 1377 1409 0:1,k); 1378 1410 1379 1411 } 1380 1412 else if ((ball[k].pos_x+HALFBALL >= 1381 - pad_pos_x+(PAD_WIDTH/2/4) && 1413 + pad_pos_x+(pad_width/2/4) && 1382 1414 ball[k].pos_x+HALFBALL <= 1383 - pad_pos_x+2*(PAD_WIDTH/2/4)) || 1415 + pad_pos_x+2*(pad_width/2/4)) || 1384 1416 (ball[k].pos_x+HALFBALL >= 1385 - pad_pos_x+(PAD_WIDTH-2*(PAD_WIDTH/2/4)) && 1417 + pad_pos_x+(pad_width-2*(pad_width/2/4)) && 1386 1418 ball[k].pos_x+HALFBALL <= 1387 - pad_pos_x+(PAD_WIDTH-(PAD_WIDTH/2/4)) )) { 1419 + pad_pos_x+(pad_width-(pad_width/2/4)) )) { 1388 1420 1389 1421 ball[k].y = -3; 1390 1422 if (ball[k].pos_x != 0 && 1391 1423 ball[k].pos_x+BALL!=LCD_WIDTH) 1392 1424 ball[k].x = brickmania_pad_check(4,0,ball[k].pos_x+2<= 1393 - pad_pos_x+(PAD_WIDTH/2)? 1425 + pad_pos_x+(pad_width/2)? 1394 1426 0:1,k); 1395 1427 1396 1428 } 1397 1429 else if ((ball[k].pos_x+HALFBALL >= 1398 - pad_pos_x+2*(PAD_WIDTH/2/4) && 1430 + pad_pos_x+2*(pad_width/2/4) && 1399 1431 ball[k].pos_x+HALFBALL <= 1400 - pad_pos_x+3*(PAD_WIDTH/2/4)) || 1432 + pad_pos_x+3*(pad_width/2/4)) || 1401 1433 (ball[k].pos_x+2 >= 1402 - pad_pos_x+(PAD_WIDTH-3*(PAD_WIDTH/2/4)) && 1434 + pad_pos_x+(pad_width-3*(pad_width/2/4)) && 1403 1435 ball[k].pos_x+2 <= 1404 - pad_pos_x+ ((PAD_WIDTH/2)-2*(PAD_WIDTH/2/4)) )) { 1436 + pad_pos_x+ ((pad_width/2)-2*(pad_width/2/4)) )) { 1405 1437 1406 1438 ball[k].y = -4; 1407 1439 if (ball[k].pos_x != 0 && 1408 1440 ball[k].pos_x+BALL!=LCD_WIDTH) 1409 1441 ball[k].x = brickmania_pad_check(3,0,ball[k].pos_x+2<= 1410 - pad_pos_x+(PAD_WIDTH/2)? 1442 + pad_pos_x+(pad_width/2)? 1411 1443 0:1,k); 1412 1444 1413 1445 } 1414 1446 else if ((ball[k].pos_x+HALFBALL >= 1415 - pad_pos_x+3*(PAD_WIDTH/2/4) && 1447 + pad_pos_x+3*(pad_width/2/4) && 1416 1448 ball[k].pos_x+HALFBALL <= 1417 - pad_pos_x+4*(PAD_WIDTH/2/4)-2) || 1418 - (ball[k].pos_x+2 >= pad_pos_x+(PAD_WIDTH/2+2) && 1449 + pad_pos_x+4*(pad_width/2/4)-2) || 1450 + (ball[k].pos_x+2 >= pad_pos_x+(pad_width/2+2) && 1419 1451 ball[k].pos_x+2 <= 1420 - pad_pos_x+(PAD_WIDTH-3*(PAD_WIDTH/2/4)) )) { 1452 + pad_pos_x+(pad_width-3*(pad_width/2/4)) )) { 1421 1453 1422 1454 ball[k].y = -4; 1423 1455 if (ball[k].pos_x != 0 && ··· 1441 1473 if (ball[k].pos_y+5 >= PAD_POS_Y && 1442 1474 (pad_type==1 && !ball[k].glue) && 1443 1475 (ball[k].pos_x >= pad_pos_x && 1444 - ball[k].pos_x <= pad_pos_x+PAD_WIDTH)) { 1476 + ball[k].pos_x <= pad_pos_x+pad_width)) { 1445 1477 ball[k].y=0; 1446 1478 ball[k].pos_y=PAD_POS_Y-BALL; 1447 1479 ball[k].glue=true; ··· 1511 1543 touch_y = rb->button_get_data() & 0xffff; 1512 1544 if(touch_y >= PAD_POS_Y && touch_y <= PAD_POS_Y+PAD_HEIGHT) 1513 1545 { 1514 - pad_pos_x += (flip_sides ? -1 : 1) * ( (touch_x-pad_pos_x-PAD_WIDTH/2) / 4 ); 1546 + pad_pos_x += (flip_sides ? -1 : 1) * ( (touch_x-pad_pos_x-pad_width/2) / 4 ); 1515 1547 1516 1548 if(pad_pos_x < 0) 1517 1549 pad_pos_x = 0; 1518 - else if(pad_pos_x+PAD_WIDTH > LCD_WIDTH) 1519 - pad_pos_x = LCD_WIDTH-PAD_WIDTH; 1550 + else if(pad_pos_x+pad_width > LCD_WIDTH) 1551 + pad_pos_x = LCD_WIDTH-pad_width; 1520 1552 for(k=0;k<used_balls;k++) 1521 1553 if ((start_game==1 || ball[k].glue)) 1522 - ball[k].pos_x = pad_pos_x+PAD_WIDTH/2; 1554 + ball[k].pos_x = pad_pos_x+pad_width/2; 1523 1555 } 1524 1556 1525 1557 if(button & BUTTON_REL) ··· 1540 1572 continue; 1541 1573 if ((button_right && flip_sides==false) || 1542 1574 (button_left && flip_sides==true)) { 1543 - if (pad_pos_x+8+PAD_WIDTH > LCD_WIDTH) { 1575 + if (pad_pos_x+8+pad_width > LCD_WIDTH) { 1544 1576 for(k=0;k<used_balls;k++) 1545 1577 if (start_game==1 || ball[k].glue) 1546 - ball[k].pos_x+=LCD_WIDTH-pad_pos_x-PAD_WIDTH; 1547 - pad_pos_x+=LCD_WIDTH-pad_pos_x-PAD_WIDTH; 1578 + ball[k].pos_x+=LCD_WIDTH-pad_pos_x-pad_width; 1579 + pad_pos_x+=LCD_WIDTH-pad_pos_x-pad_width; 1548 1580 } 1549 1581 else { 1550 1582 for(k=0;k<used_balls;k++) ··· 1579 1611 if (start_game==1 && con_game!=1 && pad_type!=1) { 1580 1612 for(k=0;k<used_balls;k++) { 1581 1613 ball[k].y=-4; 1582 - ball[k].x=pad_pos_x+(PAD_WIDTH/2)-2>= 1614 + ball[k].x=pad_pos_x+(pad_width/2)-2>= 1583 1615 LCD_WIDTH/2?2:-2; 1584 1616 } 1585 1617 start_game =0; ··· 1605 1637 fire[tfire].left=pad_pos_x+1; 1606 1638 tfire=brickmania_fire_space(); 1607 1639 fire[tfire].top=PAD_POS_Y-7; 1608 - fire[tfire].left=pad_pos_x+PAD_WIDTH-1; 1640 + fire[tfire].left=pad_pos_x+pad_width-1; 1609 1641 } else if (con_game==1 && start_game!=1) { 1610 1642 for(k=0;k<used_balls;k++) { 1611 1643 ball[k].x=x[k];
+1
docs/CREDITS
··· 483 483 Ralph Soto 484 484 Mykhailo Radzievskyi 485 485 Christophe Gouiran 486 + Asael Reiter 486 487 487 488 The libmad team 488 489 The wavpack team