Math.atan2 appears to be AWOL

This morning, because I’m coding a space thing in Kotlin, I opened my Coda Asteroids game and ran it. It crashed looking for math.atan2.

Has atan2 gone missing?

Thanks for all the fish …

R

Lua 5.4 deprecated some functions including pow and atan2. You can now use a ^ b for exponents and atan with two parameters replaces atan2 (so just remove the 2)

1 Like

@RonJeffries - ran into that one myself. Had me flummoxed for a while. But …

Don’t Panic !!!

thanks! I would not have guessed that … the docs need to be updated.

1 Like

@RonJeffries yes this was a very sneaky change from the creator of Lua. I’ll make a note about updating the docs. We could also chuck in a math.pow and math.atan2 function for backwards compatibility