1
0
Fork 0

feat(collision): check grid bounds in x axis.

This commit is contained in:
Henrik Hautakoski 2025-09-15 06:47:48 +02:00
parent 5853fb1238
commit aeaf6cb5c4

View file

@ -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