diff --git a/main.go b/main.go index d9953cb..644f020 100644 --- a/main.go +++ b/main.go @@ -15,13 +15,14 @@ import ( ) var ( - shape game.Shape - shape_pos core.Vec2i8 - score game.Score - dropTimer = core.NewIntervalTimer(0.3) - moveTimer = core.NewIntervalTimer(0.1) - grid = game.Grid{} - nextShape = game.NewShape(game.SHAPE_O) + shape game.Shape + shape_pos core.Vec2i8 + score game.Score + dropTimer = core.NewIntervalTimer(0.3) + moveTimer = core.NewIntervalTimer(0.1) + grid = game.Grid{} + nextShape = game.NewShape(game.SHAPE_O) + shapeQueue = game.NewShapeQueue() r = draw.Renderer{ Theme: &draw.Theme{ @@ -36,8 +37,8 @@ var ( func SpawnShape() { shape = nextShape + nextShape = shapeQueue.Next() shape_pos = core.Vec2i8{X: 4, Y: 0} - nextShape = game.NewShape((nextShape.Type() + 1) % 7) } func LockShape() { @@ -123,6 +124,8 @@ func main() { render.SetTexture(texture) render.SetFont(&assets.Font) + nextShape = shapeQueue.Next() + SpawnShape() for !rl.WindowShouldClose() {