fix: reset state on Enter()
This commit is contained in:
parent
54a7821df0
commit
cd750a5508
1 changed files with 3 additions and 0 deletions
|
|
@ -44,6 +44,9 @@ func NewGamePlay() *GamePlay {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (gp *GamePlay) Enter() {
|
func (gp *GamePlay) Enter() {
|
||||||
|
gp.grid = game.Grid{}
|
||||||
|
gp.score = 0
|
||||||
|
gp.dropTimer.SetInterval(0.3)
|
||||||
gp.shapeQueue = game.NewShapeQueue()
|
gp.shapeQueue = game.NewShapeQueue()
|
||||||
gp.nextShape = gp.shapeQueue.Next()
|
gp.nextShape = gp.shapeQueue.Next()
|
||||||
gp.SpawnShape()
|
gp.SpawnShape()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue