We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 248e072 commit da0791aCopy full SHA for da0791a
1 file changed
games/snakegame/snakegame/snakegame.go
@@ -66,7 +66,6 @@ func (g *Game) spawnFood() {
66
func (g *Game) Update() error {
67
if g.state == StateOpening || g.state == StateGameOver {
68
if isAnyKeyJustPressed() {
69
- g.state = StatePlaying
70
g.Init()
71
g.state = StatePlaying
72
}
@@ -105,7 +104,7 @@ func (g *Game) Update() error {
105
104
if g.dir.x == 1 {
106
g.pendingDir = Point{0, -1}
107
} else if g.dir.y == 1 {
108
-
+ g.pendingDir = Point{1, 0}
109
} else if g.dir.x == -1 {
110
g.pendingDir = Point{0, 1}
111
} else if g.dir.y == -1 {
0 commit comments