| 03-19-2009, 03:34 PM | #1 |
I'd like to find an efficient way of doing this that would involve storing a minimal amount of struct variables. Currently, I am moving three closely packed units using a central line that serves as the "middle" of the wave. I store the x and y speeds (using Cos and Sin) and increment along the line. The current point on the line serves as the base point to which I add the Sin of the angle determined by the current distance (the angle is obtained by multiplying 2pi by the ratio of the sum of the increments to the wavelength), which involves a second projection and another set of x/y speeds to store in the struct. It seems a little burdensome to me. I've looked at Anitarf's Spirit Helix spell and he uses two mirrored sine waves (instead of a single one) and multiple attributes of the wave (such as width, wavelength, starting point of the units). The script also involves use of two variables hoffset and voffset, which I haven't figured out at all. Would anyone mind either explaining how the Spirit Helix method is applicable to my spell or giving me a better choice? |
| 03-20-2009, 01:52 AM | #2 |
The hoffset and voffset variables are the horizontal and the vertical offsets from the central line. They are calculated based on how far along the central line the projectiles are, and then they are used to calculate the final coordinates and flying height of the projectiles. |
