Change Attribute

NatJ3NatJ3 Member Posts: 3
edited November -1 in Working with GS (Mac)
My main actor has a change attribute>game.Integer to 1 under that I have a rule>attribute=1. In that rule I have a move behavior setting it at a 90 degree angle when touch is pressed. so it will move up.

Okay so say I wanted to change that to a reverse where he would move down instead, I added another rule under the previous rule to say that when attribute=2 move down at a 270 degree angle.

well I set that then made another actor (power up), I went into that actor and put a rule>when overlaps or collides with main actor change attribute to 2

How can I get the main character to change back to attribute one after it touches this power up twice?

Comments

  • thebitmasterthebitmaster PRO Posts: 75
    I would add a local variable inside the main actor to count how many times the collision with the power-up occurs, then change the variable back to 1 on the second collision.

    Keep in mind that the collision only happens on the initial contact. If the actors remain overlapped (because they don't bounce) you won't get another collision event until they separate and hit each other again.
  • thebitmasterthebitmaster PRO Posts: 75
    Let me make that slightly less ambiguous:

    I would add a local variable inside the main actor to count how many times the collision with the power-up occurs, then change the facing variable you mentioned back to 1 on the second collision.
Sign In or Register to comment.