Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jean Descamps
projet_IA04
Commits
3f54f38c
Commit
3f54f38c
authored
Jan 03, 2022
by
Louis Soto
Browse files
Update graphics.go (pour la fin du jeu dans le cas d'une victoire)
parent
0eb35767
Changes
1
Hide whitespace changes
Inline
Side-by-side
Boid/game/graphics.go
View file @
3f54f38c
...
...
@@ -156,7 +156,7 @@ func (gra *Graphics) DrawWalls(screen *ebiten.Image, walls []*worldelements.Wall
}
//DrawInterface fonction qui permet d'afficher les différents textes de l'interface.
func
(
g
*
Graphics
)
DrawInterface
(
screen
*
ebiten
.
Image
,
score
Score
,
gameOver
bool
)
{
func
(
g
*
Graphics
)
DrawInterface
(
screen
*
ebiten
.
Image
,
score
Score
,
gameOver
bool
,
end
bool
)
{
//Draw GUI
text
.
Draw
(
screen
,
"Level: "
+
strconv
.
Itoa
(
score
.
Level
+
1
),
g
.
scoreFont
,
32
,
32
,
color
.
RGBA
{
100
,
100
,
100
,
255
})
text
.
Draw
(
screen
,
"Score: "
+
strconv
.
Itoa
(
score
.
Value
),
g
.
scoreFont
,
utils
.
ScreenWidth
/
2
-
50
,
32
,
color
.
RGBA
{
100
,
100
,
100
,
255
})
...
...
@@ -171,6 +171,10 @@ func (g *Graphics) DrawInterface(screen *ebiten.Image, score Score, gameOver boo
text
.
Draw
(
screen
,
"Game over"
,
g
.
scoreFont
,
utils
.
ScreenWidth
/
2
-
50
,
utils
.
ScreenHeight
/
2
+
132
,
color
.
RGBA
{
53
,
223
,
26
,
255
})
}
if
end
{
text
.
Draw
(
screen
,
"you won: "
,
g
.
scoreFont
,
utils
.
ScreenWidth
/
2
-
50
,
utils
.
ScreenHeight
/
2
+
132
,
color
.
RGBA
{
53
,
223
,
26
,
255
})
}
//Draw polygon
for
i
:=
1
;
i
<
len
(
g
.
polygon
);
i
++
{
ebitenutil
.
DrawLine
(
screen
,
g
.
polygon
[
i
-
1
]
.
X
,
g
.
polygon
[
i
-
1
]
.
Y
,
g
.
polygon
[
i
]
.
X
,
g
.
polygon
[
i
]
.
Y
,
color
.
RGBA
{
120
,
12
,
200
,
255
})
...
...
Write
Preview
Supports
Markdown
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