Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Direction Indicator
- TheWildCard-SC
-
Scratcher
1 post
Direction Indicator
Does anyone have any idea on how to make a direction indicator? I've been struggling to make one that is accurate. An example would be if a projectile came from a direction, and an indicator would pop up pointing in that direction. If anyone has any ideas it would be much appreciated!
- GamingCat12345
-
Scratcher
500+ posts
Direction Indicator
If you can tell where both the player and the projectile is, you can use an equation to determine the direction.
(([atan v] of (((proj x) - (player x)) / ((proj y) - (player y)))::operators) + (<(proj x) < (player x)> * (180))(If you know trig, do note that because Scratch's directional wheel is wonk, all the sin/cosine and whatnot is flipped)
- Discussion Forums
- » Help with Scripts
- » Direction Indicator
