Rotating String
BlitzPlus Forums/BlitzPlus Programming/Rotating String
| ||
Is there any way to rotate a string or a number around a character without using waypoints? What I mean is to have the string or number revolve around the character's image like the earth around the Sun (but not to scale!). If anyone even mildly understands what I mean and thinks they can help, please respond. |
| ||
uuuuuuuuuuuuuuuuuuh...... you mean having some text circling around a player ? |
| ||
Exactly. You're better with these - how you say? - words. |
| ||
'terminology' Your character has x and y variables, right? Suppose we want to have an 'option' circling around it (ever played Gradius?) then this option has its own x and y coords. And at each game-update you update this option's x/y coords. The most flexible way is creating a lookup table for the optionpath, this way you can also easily create 8-figures, triangles, squares etc. Create 2 arrays: pathx(99) pathy(99) for 100 phases then fill them with a circle-path for t=0 to 99 pathx(t)=sin(t*360/100)*40 pathy(t)=cos(t*360/100)*40 next '40' being the distance here, create an elipse by using different values for the x distance and y distance If you want more spooky figures, try this: pathx(t)=sin((t*a)*360/100)*40 pathy(t)=cos((t*b)*360/100)*40 use integer values for a and b .. In the game: in your mainloop, have some phase variable which is updated at each game-update, and make sure it moves between 0 and 100: phase=(phase+1) mod 100 Then at the drawing: ; draw player at X,Y ; draw option at X+pathx(phase),Y+pathy(phase) c'est ca.. haven't tested it btw ^___^ good luck with it.. |
| ||
Thanks... actually, Gradius was exactly what I had in mind! I wasn't sure if you'd know what it was. Speaking of which, don't you think ice skaters should skate to Gradius' "Burning Heat"? Anyway, thanks a lot. I'll give it a try. |
| ||
It works great! I'm not sure how much I like it, but it works fine!! Thanks so much! |