From dab2570b76c224ad3b6b3741c3cb0381d403fa79 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sun, 14 Sep 2025 22:37:54 +0200 Subject: [PATCH] feat(collision): check for collision against blocks in the grid. --- game/collision.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/game/collision.go b/game/collision.go index 5761563..c9e5b2b 100644 --- a/game/collision.go +++ b/game/collision.go @@ -15,6 +15,10 @@ func CheckShapeCollision(pos core.Vec2i8, shape *Shape, grid *Grid) bool { if block.Y >= int8(grid.Height()) { return true } + + if grid.At(byte(block.X), byte(block.Y)) != BLOCK_EMPTY { + return true + } } return false