ScratchData LogoScratchData
Back to DarthPickley's profile

direction

DADarthPickley•Created September 11, 2008
direction
2
1
51 views
View on Scratch

Description

this is a simple show of how to calculate the direction that you would point in if you were pointing towards a point, for example, that may not have exactly been the center of a sprite, but trigonomically related to it, or which is on the screen. you can also use it so that it slowly points towards something, instead of immediately, in the same way that you would do [if distance to mouse pointer>5 then [move 5 steps]] instead of [go to mouse-pointer]. it uses the asin and acos trig functions together to calculate the overall direction. You can use this "engine" in your own projects, if you give credit. thank you! note: (It's kind of glitchy if you're pointing around zero and 180 degrees and you move the mouse quickly. UPDATE: Now more user-friendly!

Project Details

Project ID263016
CreatedSeptember 11, 2008
Last ModifiedSeptember 11, 2008
SharedSeptember 11, 2008
Visibilityvisible
CommentsAllowed