From aeaf6cb5c47027c07958f7a7c2c07decb1ed49e7 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Mon, 15 Sep 2025 06:47:48 +0200 Subject: [PATCH] feat(collision): check grid bounds in x axis. --- game/collision.go | 4 ++++ 1 file changed, 4 insertions(+) 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