fix atan issue

the love2d that I'm using doesn't have the new atan arity lol
This commit is contained in:
Donald Ball 2025-11-17 20:21:42 -05:00
parent 9cdf032c39
commit f5df911707
3 changed files with 40 additions and 23 deletions

View file

@ -26,7 +26,23 @@ function TestApply()
phys.apply(actor, { speed = 1, angle = math.pi / 2 })
t.assertAlmostEquals(
actor,
{ x = 0, y = 0, speed = math.sqrt(2), angle = math.pi * 3 / 4 }
{ x = 0, y = 0, speed = math.sqrt(2), angle = math.pi * 3 / 4 })
actor = { x = 0, y = 0, speed = 0, angle = 0 }
phys.apply(actor, { speed = 1, angle = math.pi / 2 })
t.assertAlmostEquals(
actor,
{ x = 0, y = 0, speed = 1, angle = math.pi / 2 })
phys.apply(actor, { speed = 1, angle = math.pi / 2 })
t.assertAlmostEquals(
actor,
{ x = 0, y = 0, speed = 2, angle = math.pi / 2 })
phys.apply(actor, { speed = 1, angle = math.pi })
t.assertAlmostEquals(
actor,
{ x = 0, y = 0, speed = 0, angle = 0 }
)
end