I need a script to let me rotate a sprite, not around its center but around the center of a different sprite. does anyone know how to do this?
Offline
Well there's several ways you could do this. You could change the costume center in the paint editor so it's offset the right distance from the sprite, then just have it turn like normal. Or, if the sprite is going to be doing more than just that, you could use trigonometry.
Offline
Like Harakou said, it's possible to achieve this by changing the sprite's costume center. However, it can be quite difficult to get that just right and it's a pain to work with. Trigonometry, however difficult it may be to understand, should do the trick. If you'd like, I can make a project demonstrating how to do this for you.
Offline
What I was looking for was one that would rotate around the second sprite regardless of where the second sprite was. I don't think changing the center would work for that. If trigonometry would work then please could you make the demonstration project.
BTW, its for a racing game where the background scrolls and rotates
Offline
stickfiregames wrote:
What I was looking for was one that would rotate around the second sprite regardless of where the second sprite was. I don't think changing the center would work for that. If trigonometry would work then please could you make the demonstration project.
BTW, its for a racing game where the background scrolls and rotates
Make it point to the right sprite, turn 90 degrees then move ___ steps.
Offline
You can use this if you want:
http://scratch.mit.edu/projects/TheBajeebas/1311476
Offline
Actually, you don't need trigonometry (I think you got an answer by now, but still). Just make (point towards sprite) (go to sprite) (rotate 180* clockwise) (move how far you want to be away from sprite) (rotate 90* clockwise) (move 10 steps).
Offline