Actor walks on line path
Hello,
Is it possible to move an actor on predefined line (see the image)?
[URL=http://imageshack.us/photo/my-images/7/bozeforum.png/][IMG]http://img7.imageshack.us/img7/2568/bozeforum.th.png[/IMG][/URL]
http://imageshack.us/photo/my-images/7/bozeforum.png/
I want when the actor spawns to random choose between the three lines an then to walk from the beginning of the line to the end and then destroys.
Any idea how to make this.
Is it possible to move an actor on predefined line (see the image)?
[URL=http://imageshack.us/photo/my-images/7/bozeforum.png/][IMG]http://img7.imageshack.us/img7/2568/bozeforum.th.png[/IMG][/URL]
http://imageshack.us/photo/my-images/7/bozeforum.png/
I want when the actor spawns to random choose between the three lines an then to walk from the beginning of the line to the end and then destroys.
Any idea how to make this.
Comments
Start with a self.attribute: self.path (integer type)
Start the actor with a Change Attribute self.path to Random(1,3)
RULE;
Move to: X:100, Y:100
RULE:
When X=100 & Y=100
Move to X=300, Y:100
RULE:
When X=300 & Y=100
Move to X:100, Y:100
Wrap that in a bigger rule that when self.path = 1...
Do that for self.path = 2, and self.path = 3
http://itunes.apple.com/us/app/fright-control-lite/id422673852?mt=8 (free version)
The problem is that I need to spawn like 20 or more actors and this slows down my game (that's way i need another solution, will recycle actor instead of spawn help?).
I will look at this fright control game and orbz demo and post again.
PS. When I make move to, and then in rule if X=100 & Y=100, this doesn't work so I used the rule self.moving=false. Why the actor does not move to the move to coordinates
If I upload my solution will someone try to optimize the actor?