Centipede(arcade) like Movement. Help with logic!

overzero3overzero3 Member Posts: 18
edited October 2012 in Working with GS (Mac)
So...
I'm trying to make an NPC that moves like the Centipede from classic arcades, or Nokia's cell Snake, but I'm having some troubles making it right, so as always i'm crying over here for help.
The actors logic is this: I made two attributes, Step and Mark. The first one tells me in which direction my actor should move and the other one i use to measure when to change for the next step. So, in Step 1 (rule group) my actor move to the right (0°) and then I change the Mark attribute to his current position.X. Next I made a rule that says that when the Mark is equal/smaller than postion.X + 200 (the amout of movement i want to move before changing direction), change to Step 2.
In Step two, i make the same set of rules, but this time changing the Move direction to down (270°) and the Mark to the Y position. Do it again for Step 3 (180°) and Step 4 (270° again) and back to Step 1 again!
Don't know if i made it clear enough, it's really hard to explain. Anyway, the problem is that once i hit Step 3, it changes automatically to Step 4, so it never goes to the left. I even put an change color to make sure it was making through this step, and it is! The problem is that it just past right through it, without moving to the left. All the rules are basically the same, so if the logic worked for one, it should work for the others, right?
Does anyone knows of a better way to make this kind of movement?

Comments

Sign In or Register to comment.