Fix examples
This commit is contained in:
parent
70aa6f5da5
commit
f61497c79d
7 changed files with 141 additions and 122 deletions
|
@ -436,12 +436,12 @@ func (g *Game) Draw() {
|
|||
}
|
||||
} else {
|
||||
// Draw text
|
||||
rl.DrawText("Floppy Gopher", int32(rl.GetScreenWidth())/2-rl.MeasureText("Floppy Gopher", 40)/2, int32(rl.GetScreenHeight())/2-150, 40, rl.RayWhite)
|
||||
rl.DrawText("Floppy Gopher", rl.GetScreenWidth()/2-rl.MeasureText("Floppy Gopher", 40)/2, rl.GetScreenHeight()/2-150, 40, rl.RayWhite)
|
||||
|
||||
if runtime.GOOS == "android" {
|
||||
rl.DrawText("[TAP] TO PLAY", int32(rl.GetScreenWidth())/2-rl.MeasureText("[TAP] TO PLAY", 20)/2, int32(rl.GetScreenHeight())/2-50, 20, rl.Black)
|
||||
rl.DrawText("[TAP] TO PLAY", rl.GetScreenWidth()/2-rl.MeasureText("[TAP] TO PLAY", 20)/2, rl.GetScreenHeight()/2-50, 20, rl.Black)
|
||||
} else {
|
||||
rl.DrawText("[ENTER] TO PLAY", int32(rl.GetScreenWidth())/2-rl.MeasureText("[ENTER] TO PLAY", 20)/2, int32(rl.GetScreenHeight())/2-50, 20, rl.Black)
|
||||
rl.DrawText("[ENTER] TO PLAY", rl.GetScreenWidth()/2-rl.MeasureText("[ENTER] TO PLAY", 20)/2, rl.GetScreenHeight()/2-50, 20, rl.Black)
|
||||
}
|
||||
|
||||
// Draw Gopher
|
||||
|
|
|
@ -103,7 +103,7 @@ func (g *Game) Init() {
|
|||
// Update - Update game
|
||||
func (g *Game) Update() {
|
||||
if !g.GameOver {
|
||||
if rl.IsKeyPressed('P') {
|
||||
if rl.IsKeyPressed(rl.KeyP) {
|
||||
g.Pause = !g.Pause
|
||||
}
|
||||
|
||||
|
@ -231,7 +231,7 @@ func (g *Game) Draw() {
|
|||
rl.DrawText("GAME PAUSED", g.ScreenWidth/2-rl.MeasureText("GAME PAUSED", 40)/2, g.ScreenHeight/2-40, 40, rl.Gray)
|
||||
}
|
||||
} else {
|
||||
rl.DrawText("PRESS [ENTER] TO PLAY AGAIN", int32(rl.GetScreenWidth())/2-rl.MeasureText("PRESS [ENTER] TO PLAY AGAIN", 20)/2, int32(rl.GetScreenHeight())/2-50, 20, rl.Gray)
|
||||
rl.DrawText("PRESS [ENTER] TO PLAY AGAIN", rl.GetScreenWidth()/2-rl.MeasureText("PRESS [ENTER] TO PLAY AGAIN", 20)/2, rl.GetScreenHeight()/2-50, 20, rl.Gray)
|
||||
}
|
||||
|
||||
rl.EndDrawing()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue