Something a bit complex for my tiny brain....
AfterBurnett
Member Posts: 3,474
Okay, so I understand how to get stuff moving in a circle (actually I don't, I'm just using tutorials - LOL). My question is, how do I get that circle to follow another actor? What I want to do is have a ring of actors spinning around a boss character... you have to destroy them before you can get to the boss... this would be simple but I want the boss to move.
Any thoughts?
Any thoughts?
Comments
Hope that helps
In the boss Actor Prototype, add these two behaviors:
Constrain Attribute: game.bossX To: self.Position.X
Constrain Attribute: game.bossY To: self.Position.Y
In the Orbiting Actor Prototype, add these Attributes:
an integer Attribute called 'myRadius' - set this to 100
an integer Attribute called 'mySpeed' - set this to 400
an integer Attribute called 'myOffset' - leave this blank for now
Then add these two behaviors:
Constrain Attribute: self.Position.X To: self.myRadius*cos(( self.Time + self.myOffset)*self.mySpeed%360)+ game.bossX
Constrain Attribute: self.Position.Y To: self.myRadius*sin(( self.Time + self.myOffset)*self.mySpeed%360)+ game.bossY
Now, drag the boss Actor as well as many orbiters as you want into the Scene.
Double-click on each orbiter instance and set their 'myOffset' Attribute.
This will be their distance between each other...(otherwise they would all be on top of one another)
(The only thing to watch out for is that each orbiter requires 2 Constrains...
too many Constrains will negatively affect the FPS)
Hope this helps!
Joe
http://gamesalad.com/game/play/39926
I'll think about it..