Toggle Fullscreen with F for my shitty laptop

This commit is contained in:
bdnugget 2024-09-23 15:04:14 +02:00
parent 8958c3328f
commit 937cc5deba

View File

@ -8,7 +8,7 @@ import (
) )
const ( const (
screenWidth = 1600 screenWidth = 1300
screenHeight = 800 screenHeight = 800
numLanes = 5 numLanes = 5
numGarages = 5 numGarages = 5
@ -98,6 +98,10 @@ func (g *Game) draw() {
} }
func (g *Game) update() { func (g *Game) update() {
if rl.IsKeyPressed(rl.KeyF) {
rl.ToggleFullscreen()
}
if g.gameOver { if g.gameOver {
if rl.IsKeyPressed(rl.KeyEnter) { if rl.IsKeyPressed(rl.KeyEnter) {
*g = *NewGame() *g = *NewGame()