Commit 3f54f38c authored by Louis Soto's avatar Louis Soto
Browse files

Update graphics.go (pour la fin du jeu dans le cas d'une victoire)

parent 0eb35767
......@@ -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})
......
Supports Markdown
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