HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

How to make a unit move in a spiral way?

01-23-2010, 01:59 PM#1
Michael Peppers
So... I have to make a unit move like this... but I have no idea on how to code it.

Also, since a spiral can be treated like a circle with a continuously decreasing radius, an explanation on how can I make a unit move in a circular way will suffice.
01-23-2010, 02:26 PM#2
Saishy
This is how you do polar projections (Take a point UNITS away from a CORD using ANGLE)

Collapse JASS:
        set x = XCORD + UNITS * Cos(ANGLE)
        set y = YCORD + UNITS * Sin(ANGLE)

So, just use XCORD and YCORD as the center of your spiral, and then keep changing the angle (which must be in Radians) and lower the UNITS.
01-23-2010, 02:33 PM#3
Michael Peppers
Quote:
Originally Posted by Saishy
This is how you do polar projections (Take a point UNITS away from a CORD using ANGLE)

Collapse JASS:
        set x = XCORD + UNITS * Cos(ANGLE)
        set y = YCORD + UNITS * Sin(ANGLE)

So, just use XCORD and YCORD as the center of your spiral, and then keep changing the angle (which must be in Radians) and lower the UNITS.
Seems fair... rep deserved =D

EDIT: 1000th post FTW!