Closed DNin01 closed 1 month ago
Scratch.Cast.toNumber also convertes NaN to 0. As a result, all Scratch blocks treat NaN inputs as 0 instead of letting NaN propagate like they do in JS.
you need the Cast.toNumber still
Oh, ok!
@GarboMuffin
original gives 225, new ones gives -135. so they're both the same actual angle but I don't know if we want to be changing how this block works
sometimes we can have a v2 of the block and then keep the old one around but hidden if it makes sense
This ok, @GarboMuffin?
Changed the "direction of x1,y1 to x2,y2" function to use Math.atan2. It does the same thing but with less lines of code.
Tested pretty much everything I can think of, atan2(0, 0) is 0, output ranges from -180 to 180, atan2 already auto-converts strings to numbers.