README and persist high score on game over screen
This commit is contained in:
parent
a3dd393b7f
commit
c9d3d0c65f
@ -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
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
### note Garage texture
|
### note Garage texture
|
||||||
|
4
main.go
4
main.go
@ -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
BIN
resources/screenshot.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 43 KiB |
Loading…
x
Reference in New Issue
Block a user