Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
TP7projet_jeu_air_defense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MARQUE Pierre
TP7projet_jeu_air_defense
Commits
f3151ebd
Commit
f3151ebd
authored
Nov 02, 2020
by
Pierre MARQUE
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rendu final
parent
cd4f5c83
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1477 additions
and
11 deletions
+1477
-11
air_defense.c
air_defense.c
+9
-9
air_defense.exe
air_defense.exe
+0
-0
air_defense.h
air_defense.h
+0
-2
cheatSheet.pdf
cheatSheet.pdf
+0
-0
raylib.h
raylib.h
+1468
-0
No files found.
air_defense.c
View file @
f3151ebd
...
@@ -241,7 +241,7 @@ void UpdateGame(void)
...
@@ -241,7 +241,7 @@ void UpdateGame(void)
{
{
paratrooper
[
i
]
=
InitializeParatrooper
();
paratrooper
[
i
]
=
InitializeParatrooper
();
life
--
;
life
--
;
gameOver
=
(
life
=
=
0
);
gameOver
=
(
life
<
=
0
);
}
}
}
}
...
@@ -339,8 +339,9 @@ void UpdateGame(void)
...
@@ -339,8 +339,9 @@ void UpdateGame(void)
DrawCircleLines
(
bullet
[
j
].
position
.
x
+
4
,
bullet
[
j
].
position
.
y
,
10
,
YELLOW
);
DrawCircleLines
(
bullet
[
j
].
position
.
x
+
4
,
bullet
[
j
].
position
.
y
,
10
,
YELLOW
);
DrawCircleLines
(
bullet
[
j
].
position
.
x
+
8
,
bullet
[
j
].
position
.
y
,
5
,
RED
);
DrawCircleLines
(
bullet
[
j
].
position
.
x
+
8
,
bullet
[
j
].
position
.
y
,
5
,
RED
);
paratrooper
[
i
].
life
--
;
paratrooper
[
i
].
life
--
;
Vector2
v
=
bullet
[
j
].
position
;
Vector2
vbullet
=
bullet
[
j
].
position
;
bullet
[
j
].
ammoShot
=
false
;
float
rbullet
=
bullet
[
j
].
radius
;
bullet
[
j
]
=
InitializeBullet
();
//Kill paras
//Kill paras
if
(
paratrooper
[
i
].
life
==
0
)
if
(
paratrooper
[
i
].
life
==
0
)
{
{
...
@@ -351,7 +352,7 @@ void UpdateGame(void)
...
@@ -351,7 +352,7 @@ void UpdateGame(void)
{
{
if
(
paratrooper
[
s
].
droped
)
if
(
paratrooper
[
s
].
droped
)
{
{
if
(
CheckCollisionCircleRec
(
v
,
bullet
[
j
].
radius
+
20
,
paratrooper
[
s
].
hitbox
))
if
(
CheckCollisionCircleRec
(
v
bullet
,
rbullet
+
20
,
paratrooper
[
s
].
hitbox
))
{
{
paratrooper
[
s
].
life
--
;
paratrooper
[
s
].
life
--
;
//Kill paras
//Kill paras
...
@@ -375,16 +376,15 @@ void UpdateGame(void)
...
@@ -375,16 +376,15 @@ void UpdateGame(void)
{
{
if
(
CheckCollisionCircleRec
(
bombshells
[
j
].
position
,
bombshells
[
j
].
radius
,
aircraft
[
i
].
hitbox
))
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
,
bombshells
[
j
].
position
.
y
,
15
,
RED
);
DrawCircle
(
bombshells
[
j
].
position
.
x
+
4
,
bombshells
[
j
].
position
.
y
,
10
,
YELLOW
);
DrawCircle
(
bombshells
[
j
].
position
.
x
+
4
,
bombshells
[
j
].
position
.
y
,
10
,
YELLOW
);
aircraft
[
i
].
life
=
aircraft
[
i
].
life
-
1
;
aircraft
[
i
].
life
=
aircraft
[
i
].
life
-
1
;
PlaySound
(
soundExplosion
);
PlaySound
(
soundExplosion
);
bombshells
[
j
]
=
InitializeBombshell
();
//Kill aircrafts
//Kill aircrafts
if
(
aircraft
[
i
].
life
==
0
)
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
,
aircraft
[
i
].
hitbox
.
y
,
15
,
WHITE
);
DrawCircle
(
aircraft
[
i
].
hitbox
.
x
+
4
,
aircraft
[
i
].
hitbox
.
y
,
10
,
YELLOW
);
DrawCircle
(
aircraft
[
i
].
hitbox
.
x
+
4
,
aircraft
[
i
].
hitbox
.
y
,
10
,
YELLOW
);
DrawCircle
(
aircraft
[
i
].
hitbox
.
x
+
8
,
aircraft
[
i
].
hitbox
.
y
,
5
,
RED
);
DrawCircle
(
aircraft
[
i
].
hitbox
.
x
+
8
,
aircraft
[
i
].
hitbox
.
y
,
5
,
RED
);
...
@@ -577,13 +577,13 @@ Aircraft InitializeAircraft(void)
...
@@ -577,13 +577,13 @@ Aircraft InitializeAircraft(void)
{
{
aircraft
.
hitbox
.
x
=
-
GetRandomValue
(
0
,
300
);
aircraft
.
hitbox
.
x
=
-
GetRandomValue
(
0
,
300
);
aircraft
.
speed
.
x
=
0
.
5
+
0
.
5
*
((
float
)
GetRandomValue
(
0
,
1
));
aircraft
.
speed
.
x
=
0
.
5
+
0
.
5
*
((
float
)
GetRandomValue
(
0
,
1
));
aircraft
.
xFirstToJump
=
GetRandomValue
(
8
0
,
screenWidth
/
2
);
aircraft
.
xFirstToJump
=
GetRandomValue
(
9
0
,
screenWidth
/
2
);
}
}
else
else
{
{
aircraft
.
speed
.
x
=
-
(
0
.
5
+
0
.
5
*
((
float
)
GetRandomValue
(
0
,
1
)));
aircraft
.
speed
.
x
=
-
(
0
.
5
+
0
.
5
*
((
float
)
GetRandomValue
(
0
,
1
)));
aircraft
.
hitbox
.
x
=
GetRandomValue
(
screenWidth
,
screenWidth
+
300
);
aircraft
.
hitbox
.
x
=
GetRandomValue
(
screenWidth
,
screenWidth
+
300
);
aircraft
.
xFirstToJump
=
GetRandomValue
(
screenWidth
/
2
,
screenWidth
-
8
0
);
aircraft
.
xFirstToJump
=
GetRandomValue
(
screenWidth
/
2
,
screenWidth
-
9
0
);
}
}
aircraft
.
speed
.
y
=
0
;
aircraft
.
speed
.
y
=
0
;
aircraft
.
color
=
GRAY
;
aircraft
.
color
=
GRAY
;
...
...
air_defense.exe
View file @
f3151ebd
No preview for this file type
air_defense.h
View file @
f3151ebd
...
@@ -13,7 +13,6 @@ typedef struct Paratrooper
...
@@ -13,7 +13,6 @@ typedef struct Paratrooper
Rectangle
hitbox
;
Rectangle
hitbox
;
Vector2
speed
;
Vector2
speed
;
Color
color
;
// yellow or red
Color
color
;
// yellow or red
Rectangle
drag
[
10
];
}
Paratrooper
;
}
Paratrooper
;
typedef
struct
Aircraft
typedef
struct
Aircraft
...
@@ -75,7 +74,6 @@ typedef struct Viewfinder
...
@@ -75,7 +74,6 @@ typedef struct Viewfinder
float
radius
;
float
radius
;
Vector2
center
;
Vector2
center
;
Color
color
;
Color
color
;
}
Viewfinder
;
}
Viewfinder
;
...
...
cheatSheet.pdf
deleted
100644 → 0
View file @
cd4f5c83
File deleted
raylib.h
0 → 100644
View file @
f3151ebd
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment