README and persist high score on game over screen

This commit is contained in:
bdnugget 2024-09-23 12:37:02 +02:00
parent a3dd393b7f
commit c9d3d0c65f
3 changed files with 5 additions and 4 deletions

View File

@ -1,5 +1,8 @@
# autogo # autogo
The silly Raylib cargame I made in C but in Go The silly Raylib cargame I made in C but in Go for my champ
## Screenshot
![Screenshot](./resources/screenshot.png)
### note Garage texture ### note Garage texture

View File

@ -90,11 +90,9 @@ func (g *Game) draw() {
// Draw car // Draw car
rl.DrawTexture(g.car.texture, int32(g.car.xPos), int32(g.car.lane*laneHeight), g.car.color) rl.DrawTexture(g.car.texture, int32(g.car.xPos), int32(g.car.lane*laneHeight), g.car.color)
// Display score or game over rl.DrawText(fmt.Sprintf("Score: %d\nHigh Score: %d", g.score, highScore), 10, 10, 32, rl.DarkGreen)
if g.gameOver { if g.gameOver {
rl.DrawText("You're not an WinRAR :(\nPress Enter to Restart", int32(screenWidth/2-150), int32(screenHeight/2-20), 32, rl.Red) rl.DrawText("You're not an WinRAR :(\nPress Enter to Restart", int32(screenWidth/2-150), int32(screenHeight/2-20), 32, rl.Red)
} else {
rl.DrawText(fmt.Sprintf("Score: %d\nHigh Score: %d", g.score, highScore), 10, 10, 32, rl.DarkGreen)
} }
} }

BIN
resources/screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB