The Daily Click ::. Forums ::. Klik Coding Help ::. Gyruss movement in MMF
 

Post Reply  Post Oekaki 
 

Posted By Message

Frank M.



Registered
  19/08/2008
Points
  171

VIP Member
30th May, 2010 at 02:02:57 -

Does anyone know how to make a ship-like object move in a circular motion in kind of like in the game Gyruss?

Thanks

 
n/a

Frank M.



Registered
  19/08/2008
Points
  171

VIP Member
30th May, 2010 at 02:58:33 -

never mind I found out how to do it...

but for future reference here's how:

Basically in the event editor under the condition of Always under the objects properties, set the X and Y values to this equation:


x =<the x coordinate of the center of the circle> + radius * cos(theta)
y = <the y coordinate of the center of the circle> - radius * sin(theta)


Figure out what you want the center of the circle to be. I just set the hotspot of the object to the center and just centered the object on the screen to get the coordinates.


radius can be calculated by this formula:

a and b are the coordinates of the center of the circle

(x-a)^2 + (Y-b)^2 = r^2

^ means power in case anyone doesn't know

Since an object's directional value only goes up to 32, we then use either a counter or an alternate value. IN which I used an alternate value.
So,

Replace theta with the object's alternate value

Set the limits of the alternate value (e.g. if the value is below 0 set it to 360 & if the value is greater than 360 set it to 0)

Finally when ever you push either left or right, be sure to either subtract the alternate value by 1 or add it by 1.

Done.




 
n/a

W3R3W00F

Drum and Bass Fueled Psycho

Registered
  08/11/2008
Points
  370

VIP MemberCardboard BoxThe Cake is a Lie
30th May, 2010 at 03:26:34 -

Pooey, I'm too late. I'll just post the mfa, anyway.

http://www.mediafire.com/?zymijqyyynm

 
n/a
   

Post Reply



 



Advertisement

Worth A Click