Commit f3151ebd authored by Pierre MARQUE's avatar Pierre MARQUE

Rendu final

parent cd4f5c83
......@@ -241,7 +241,7 @@ void UpdateGame(void)
{
paratrooper[i] = InitializeParatrooper();
life--;
gameOver = (life == 0);
gameOver = (life <= 0);
}
}
......@@ -339,8 +339,9 @@ void UpdateGame(void)
DrawCircleLines(bullet[j].position.x+4,bullet[j].position.y, 10, YELLOW);
DrawCircleLines(bullet[j].position.x+8,bullet[j].position.y, 5, RED);
paratrooper[i].life--;
Vector2 v = bullet[j].position;
bullet[j].ammoShot = false;
Vector2 vbullet = bullet[j].position;
float rbullet = bullet[j].radius;
bullet[j] = InitializeBullet();
//Kill paras
if(paratrooper[i].life == 0)
{
......@@ -351,7 +352,7 @@ void UpdateGame(void)
{
if(paratrooper[s].droped)
{
if(CheckCollisionCircleRec(v, bullet[j].radius+20, paratrooper[s].hitbox))
if(CheckCollisionCircleRec(vbullet, rbullet+20, paratrooper[s].hitbox))
{
paratrooper[s].life--;
//Kill paras
......@@ -375,16 +376,15 @@ void UpdateGame(void)
{
if(CheckCollisionCircleRec(bombshells[j].position, bombshells[j].radius, aircraft[i].hitbox))
{
bombshells[j].ammoShot = false;
DrawCircle(bombshells[j].position.x,bombshells[j].position.y, 15, RED);
DrawCircle(bombshells[j].position.x+4,bombshells[j].position.y, 10, YELLOW);
aircraft[i].life = aircraft[i].life - 1;
PlaySound(soundExplosion);
bombshells[j] = InitializeBombshell();
//Kill aircrafts
if(aircraft[i].life == 0)
{
score+=50;
score+=50;
DrawCircle(aircraft[i].hitbox.x,aircraft[i].hitbox.y, 15, WHITE);
DrawCircle(aircraft[i].hitbox.x+4,aircraft[i].hitbox.y, 10, YELLOW);
DrawCircle(aircraft[i].hitbox.x+8,aircraft[i].hitbox.y, 5, RED);
......@@ -577,13 +577,13 @@ Aircraft InitializeAircraft(void)
{
aircraft.hitbox.x = -GetRandomValue(0,300);
aircraft.speed.x = 0.5+ 0.5*((float) GetRandomValue(0,1));
aircraft.xFirstToJump = GetRandomValue(80,screenWidth/2);
aircraft.xFirstToJump = GetRandomValue(90,screenWidth/2);
}
else
{
aircraft.speed.x = -(0.5+ 0.5*((float) GetRandomValue(0,1)));
aircraft.hitbox.x = GetRandomValue(screenWidth,screenWidth+300);
aircraft.xFirstToJump = GetRandomValue(screenWidth/2,screenWidth-80);
aircraft.xFirstToJump = GetRandomValue(screenWidth/2,screenWidth-90);
}
aircraft.speed.y = 0;
aircraft.color = GRAY;
......
No preview for this file type
......@@ -13,7 +13,6 @@ typedef struct Paratrooper
Rectangle hitbox;
Vector2 speed;
Color color; // yellow or red
Rectangle drag[10];
}Paratrooper;
typedef struct Aircraft
......@@ -75,7 +74,6 @@ typedef struct Viewfinder
float radius;
Vector2 center;
Color color;
}Viewfinder;
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment