Fix up collision code and improve bullet semantics.

This commit is contained in:
Anna Rose Wiggins 2023-09-29 22:30:01 -04:00
parent 5d1c36ea2f
commit b222ce3d67
3 changed files with 44 additions and 17 deletions

View file

@ -26,14 +26,15 @@ end
function makeWalls()
makeWall(200, 0, 400, 1)
makeWall(0, 120, 1, 240)
makeWall(200, 0, 400, 1)
makeWall(0, 120, 1, 240)
makeWall(200, 240, 400, 1)
makeWall(400, 120, 1, 240)
end
function makeWall(x, y, w, h)
local wall = gfx.sprite.new()
wall:setSize(w, h)
wall:setCollideRect(0, 0, wall:getSize())
wall:moveTo(x, y)
wall:setGroupMask(0x1)
wall:add()
end