diff --git a/INIT/CasioRAM.mem b/INIT/CasioRAM.mem index a5ad70b..8c58923 100644 Binary files a/INIT/CasioRAM.mem and b/INIT/CasioRAM.mem differ diff --git a/SuperCbr.dlw b/SuperCbr.dlw index d4b5744..e525514 100644 --- a/SuperCbr.dlw +++ b/SuperCbr.dlw @@ -2,7 +2,7 @@ [_1] Type=5 -Order=1 +Order=0 Top=15 Left=2235 Height=4740 @@ -13,7 +13,7 @@ OptionA=0 [_2] Type=1 -Order=0 +Order=1 Top=15 Left=7800 Height=6885 diff --git a/SuperCbr.g1a b/SuperCbr.g1a index 0934fb0..52cce71 100644 Binary files a/SuperCbr.g1a and b/SuperCbr.g1a differ diff --git a/src/bullet.c b/src/bullet.c index ae073c2..f67b2fe 100644 --- a/src/bullet.c +++ b/src/bullet.c @@ -25,9 +25,9 @@ void bulletThrow() bullets[i].b.x=mario.p.x; bullets[i].b.y=mario.p.y+8; if (last_vx_sign==0) - bullets[i].b.vx=-9; //speed = 9 + bullets[i].b.vx=-9; //speed = 9 else - bullets[i].b.vx=9; + bullets[i].b.vx=9; bullets[i].b.vy=0; bullets[i].p1=last_vx_sign; return; @@ -37,43 +37,28 @@ void bulletThrow() void bulletsDraw() { - for (int i=0; i<2; i++) - { - if (bullets[i].type==1) - tileDraw(bullets[i].b.x-cameraX(), bullets[i].b.y-cameraY(), &bullet, (1+sgn(bullets[i].b.vy))/2, 0); - } + for (int i=0; i<2; i++) if (bullets[i].type==1) tileDraw(bullets[i].b.x-cameraX(), bullets[i].b.y-cameraY(), &bullet, (1+sgn(bullets[i].b.vy))/2, 0); } void bulletsMove() { - for (int i=0; i<2; i++) + for (int i=0; i<2; i++) if (bullets[i].type) // bullet active { - if (bullets[i].type==1) + boxJump(&bullets[i].b,4); + boxMove(&bullets[i].b); + + if (bullets[i].b.vx==0) bullets[i].type=0; // delete a bullet if it is stopped + if (bullets[i].b.y<0) bullets[i].type=0; // delete a bullet if it is out of the map + if (bullets[i].b.x<=cameraX()-bullets[i].b.w || bullets[i].b.x>=cameraX()+127) bullets[i].type=0; // delete a bullet if it is out of the screen + + // contact with ennemies + for (int a=0; a=cameraX()+127) - bullets[i].type=0; - for (int a=0; adiscovered && t->type!=NONE) - { - bool x_collide= (bullets[i].b.x<=t->b.x && t->b.xb.x+t->b.w-1 && t->b.x+t->b.wb.y && t->b.yb.y+t->b.h-1 && t->b.y+t->b.hlife=DEAD; - bullets[i].type=0; - scoreAdd(KILL_ENNEMI); - break; - } - } - } + ennemis_global[a].life=DEAD; + bullets[i].type=0; + scoreAdd(KILL_ENNEMI); + break; } } -} \ No newline at end of file + +} diff --git a/src/world.c b/src/world.c index 0612711..90e1dbb 100755 --- a/src/world.c +++ b/src/world.c @@ -75,9 +75,9 @@ void cellDraw(int cx, int cy, int sx, int sy, int plan) } if (!((brick_t*)cell)->hidden) { - if (((brick_t*)cell)->time_hit_id || !((brick_t*)cell)->content || !((brick_t*)cell)->number) tileDraw(sx, sy, &brick, 0, ((brick_t*)cell)->state); + if (((brick_t*)cell)->time_hit_id || !((brick_t*)cell)->content || ((brick_t*)cell)->number) tileDraw(sx, sy, &brick, 0, ((brick_t*)cell)->state); else tileDraw(sx, sy, &gift, 1, 0); - if (((brick_t*)cell)->content==1 && ((brick_t*)cell)->time_hit_id && ((brick_t*)cell)->time_hit_id<=4) tileDraw(sx, sy+8, &coin, 0, 0); + if (((brick_t*)cell)->content==1 && ((brick_t*)cell)->time_hit_id && ((brick_t*)cell)->time_hit_id<=4) tileDraw(sx, sy+8, &coin, 0, 0); // Draw a coin } break;