Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SnakeProject
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
Benjamin LEROUX
SnakeProject
Commits
a793a711
Commit
a793a711
authored
4 years ago
by
Benjamin LEROUX
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mute option
parent
61af3c7b
branch
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
snake.c
snake.c
+10
-0
No files found.
snake.c
View file @
a793a711
...
@@ -70,6 +70,7 @@ static Sound fruitSound ;
...
@@ -70,6 +70,7 @@ static Sound fruitSound ;
static
Sound
goldenFruitSound
;
static
Sound
goldenFruitSound
;
static
Sound
deathSound
;
static
Sound
deathSound
;
static
Music
music
;
static
Music
music
;
static
bool
isMute
;
...
@@ -134,6 +135,7 @@ void InitGame(void)
...
@@ -134,6 +135,7 @@ void InitGame(void)
snake
[
0
].
score
=
0
;
snake
[
0
].
score
=
0
;
gameOver
=
false
;
gameOver
=
false
;
pause
=
false
;
pause
=
false
;
isMute
=
false
;
counterTail
=
1
;
counterTail
=
1
;
...
@@ -254,6 +256,14 @@ void UpdateGame(void)
...
@@ -254,6 +256,14 @@ void UpdateGame(void)
{
{
if
(
IsKeyPressed
(
'P'
))
pause
=
!
pause
;
if
(
IsKeyPressed
(
'P'
))
pause
=
!
pause
;
//Mute on 'M' for azerty and qwerty keyboards
if
(
IsKeyPressed
(
59
)
||
IsKeyPressed
(
KEY_M
)
)
{
isMute
=!
isMute
;
if
(
isMute
==
true
){
SetMasterVolume
(
0
.
0
);
}
else
SetMasterVolume
(
1
.
0
);
}
if
(
!
pause
)
if
(
!
pause
)
{
{
UpdateMusicStream
(
music
);
UpdateMusicStream
(
music
);
...
...
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