diff --git a/main.go b/main.go index 8b4ad71..d9953cb 100644 --- a/main.go +++ b/main.go @@ -21,7 +21,7 @@ var ( dropTimer = core.NewIntervalTimer(0.3) moveTimer = core.NewIntervalTimer(0.1) grid = game.Grid{} - nextShape game.ShapeType + nextShape = game.NewShape(game.SHAPE_O) r = draw.Renderer{ Theme: &draw.Theme{ @@ -35,9 +35,9 @@ var ( ) func SpawnShape() { - shape = game.NewShape(nextShape) + shape = nextShape shape_pos = core.Vec2i8{X: 4, Y: 0} - nextShape = (nextShape + 1) % 7 + nextShape = game.NewShape((nextShape.Type() + 1) % 7) } func LockShape() { @@ -100,6 +100,8 @@ func Render() { r.DrawHeaderText(410, 30, "Score") r.DrawText(410, 65, fmt.Sprintf("%.7d", score)) r.DrawFrame(rl.RectangleInt32{X: 400, Y: 150, Width: 250, Height: 200}) + r.DrawHeaderText(410, 155, "Next") + draw.DrawShape(rl.NewVector2(450, 150), core.NewVec2[int8](1, 3), nextShape) render.End() }