diff --git a/game/collision.go b/game/collision.go index c9e5b2b..c153648 100644 --- a/game/collision.go +++ b/game/collision.go @@ -11,6 +11,10 @@ func CheckShapeCollision(pos core.Vec2i8, shape *Shape, grid *Grid) bool { continue } + if block.X < 0 || block.X >= int8(grid.Width()) { + return true + } + // Check if the block collides with the bottom of the grid. if block.Y >= int8(grid.Height()) { return true