Skip to content

Commit da0791a

Browse files
committed
Fix several issues
1 parent 248e072 commit da0791a

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

games/snakegame/snakegame/snakegame.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ func (g *Game) spawnFood() {
6666
func (g *Game) Update() error {
6767
if g.state == StateOpening || g.state == StateGameOver {
6868
if isAnyKeyJustPressed() {
69-
g.state = StatePlaying
7069
g.Init()
7170
g.state = StatePlaying
7271
}
@@ -105,7 +104,7 @@ func (g *Game) Update() error {
105104
if g.dir.x == 1 {
106105
g.pendingDir = Point{0, -1}
107106
} else if g.dir.y == 1 {
108-
107+
g.pendingDir = Point{1, 0}
109108
} else if g.dir.x == -1 {
110109
g.pendingDir = Point{0, 1}
111110
} else if g.dir.y == -1 {

0 commit comments

Comments
 (0)