Making actors move with touch

SB.DevSB.Dev Member Posts: 7
edited November -1 in Working with GS (Mac)
How do I make my actors move depending on what I touch during the game?
(eg. I touch a transparent square labeled RIGHT and the actor moves right)
(eg. I touch a transparent square labeled LEFT and the actor moves left)

Comments

  • expired_012expired_012 Member Posts: 1,802
    Make 2 attributes: one named moveleft one named moveright make it an integer attribute. Go into your right actor, new rule: when touch is pressed, change attribute- moveright to: 1

    Now go into the left actor and do the same but using the move left attribute

    Go into the actor that you are moving and make two rules:

    Rule 1: when moveright is 1:

    And then put in whatever behaviors you use to move that actor right in the first place

    Rule 2: when moveleft is 1

    Then put in whatever you used to move that actor left.

    If this didn't help just go into the wiki and go into how to trigger an actor using another actor. That should clear everything up :)
Sign In or Register to comment.