diff --git a/main.go b/main.go index 1e36656..ff1a9fc 100644 --- a/main.go +++ b/main.go @@ -48,7 +48,13 @@ func main() { for !rl.WindowShouldClose() { if dropTimer.UpdateReset(rl.GetFrameTime()) { - shape_pos.Y += 1 + new_pos := shape_pos + new_pos.Y += 1 + + // Update position if it does not collide + if !game.CheckShapeCollision(new_pos, &shape, &grid) { + shape_pos = new_pos + } } render.Begin(r.Theme.GridBackground)