feat(collision): check for collision against blocks in the grid.
This commit is contained in:
parent
324fd5af73
commit
dab2570b76
1 changed files with 4 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue