Oh, I didn't catch this at first. The statement "if speed<0 and speed>0 then" does not work. It will never be true.
I also didn't catch this other thing because my last math class was almost two decades ago. (-1)^.5 results in an imaginary number and is not handled by Lua. Why is that there?
|