Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
ProjetZZ1
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Marc BERET
ProjetZZ1
Commits
4e2b8336
Commit
4e2b8336
authored
Jun 23, 2022
by
belkhiritaha
Browse files
Options
Downloads
Patches
Plain Diff
fin modifications boutton rejouer
parent
3b336782
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
travail_de_groupe/chef_oeuvre/src/gest_event.c
+16
-9
16 additions, 9 deletions
travail_de_groupe/chef_oeuvre/src/gest_event.c
travail_de_groupe/chef_oeuvre/src/gest_event.h
+3
-1
3 additions, 1 deletion
travail_de_groupe/chef_oeuvre/src/gest_event.h
with
19 additions
and
10 deletions
travail_de_groupe/chef_oeuvre/src/gest_event.c
+
16
−
9
View file @
4e2b8336
...
...
@@ -2,7 +2,13 @@
SDL_Point
mousePosition
;
int
keys
[
10
];
int
keys
[
NBKEYS
];
void
initKeys
(){
for
(
int
i
=
0
;
i
<
NBKEYS
;
i
++
){
keys
[
i
]
=
0
;
}
}
void
manageMenu
(){
SDL_Event
event
;
...
...
@@ -98,6 +104,7 @@ void manageLost(){
case
SDL_MOUSEBUTTONDOWN
:
if
(
SDL_PointInRect
(
&
mousePosition
,
&
playAgainButtonRect
)){
initAll
();
initKeys
();
gameState
=
GAME
;
}
if
(
SDL_PointInRect
(
&
mousePosition
,
&
quitButtonRect
)){
...
...
@@ -128,19 +135,19 @@ void manageGame(){
running
=
0
;
continue
;
case
SDLK_
UP
:
case
SDLK_
z
:
keys
[
PLAYER_UP
]
=
0
;
break
;
case
SDLK_
DOWN
:
case
SDLK_
s
:
keys
[
PLAYER_DOWN
]
=
0
;
break
;
case
SDLK_
LEFT
:
case
SDLK_
q
:
keys
[
PLAYER_LEFT
]
=
0
;
break
;
case
SDLK_
RIGHT
:
case
SDLK_
d
:
keys
[
PLAYER_RIGHT
]
=
0
;
break
;
...
...
@@ -156,19 +163,19 @@ void manageGame(){
running
=
0
;
continue
;
case
SDLK_
UP
:
case
SDLK_
z
:
keys
[
PLAYER_UP
]
=
1
;
break
;
case
SDLK_
DOWN
:
case
SDLK_
s
:
keys
[
PLAYER_DOWN
]
=
1
;
break
;
case
SDLK_
LEFT
:
case
SDLK_
q
:
keys
[
PLAYER_LEFT
]
=
1
;
break
;
case
SDLK_
RIGHT
:
case
SDLK_
d
:
keys
[
PLAYER_RIGHT
]
=
1
;
break
;
...
...
This diff is collapsed.
Click to expand it.
travail_de_groupe/chef_oeuvre/src/gest_event.h
+
3
−
1
View file @
4e2b8336
...
...
@@ -5,8 +5,10 @@
#include
"main.h"
#include
"render.h"
#define NBKEYS 10
extern
SDL_Point
mousePosition
;
extern
int
keys
[
10
];
extern
int
keys
[
NBKEYS
];
void
*
eventLoop
(
void
*
arg
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment