diff options
| author | iamcheeseman <[email protected]> | 2026-03-11 13:19:11 -0400 |
|---|---|---|
| committer | iamcheeseman <[email protected]> | 2026-03-11 13:19:11 -0400 |
| commit | 8121de73db8acfe5264fd6e0218dc5413ffac95d (patch) | |
| tree | 2308f65d361c4ffcc365d7a16ff458ed602efc22 /main.lua | |
| parent | 9e7d27e8d43617955c8a1213b392d98e3932f7a3 (diff) | |
basic AABB collision resolution
Diffstat (limited to 'main.lua')
| -rw-r--r-- | main.lua | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -12,6 +12,14 @@ function love.load() set_scene(scn) new_player(100, 100) + + box1 = phys.Box.new(20, 20, 16, 16, { + layers = {}, + mask = {"hard"}, + }) + + ground1 = phys.Box.new(5, 50, 64, 16, {}) + ground2 = phys.Box.new(64-16, 50+16, 16, 64, {}) end function love.update(dt) @@ -19,6 +27,7 @@ function love.update(dt) assert(scn, "No scene set.") fire_event(scn.on_update, dt) + box1:update(0, 5, dt) flush_scene() end @@ -32,6 +41,10 @@ function love.draw(dt) fire_event(scn.on_draw, dt) + box1:draw() + ground1:draw() + ground2:draw() + -- TODO: Take care of weird displays lg.setCanvas() local scr_width, scr_height = lg.getDimensions() |
