Pushing a button to make an actor move - Question

RastaRiseRastaRise Member Posts: 52
edited November -1 in Working with GS (Mac)
i have four arrow left, right, up, and down. How do i make the buttons move the actor? Ex. when left arrow is touched the actor moves left.

Any help would be greatly appreciated!

Jon

Comments

  • JamesZeppelinJamesZeppelin Member Posts: 1,927
    Attributes

    Go through some of the tutorials.

    The concept is a pain to get but it is really central to GS.

    Its basically how actors speak to each other through a middleman

    Button changes attribute > actor reads change in attribute.

    There are plenty of tutorials on how to do it. THere is a jumping demo on my wall too that has it.
  • WeswogWeswog Member Posts: 1,171
    Here is a video tutorial on how to do that (I made this)


    Cheers, Weswog
  • RastaRiseRastaRise Member Posts: 52
    Thanks man just what i needed!
  • expired_012expired_012 Member Posts: 1,802
    Your trying to trigger an actor using another actor.

    Make 4 integer attributes: left, right, up, down

    Make the following rule in your left arrow:

    When touch is pressed, change attribute (left) to 1
    Otherwise, change attribute (left) to 0

    Now go into the actor that you want to move and give it the following rule:

    When attribute (left) is 1:

    Move actor (direction left)

    Otherwise

    Change attribute (left) to 0

    Do this for the other 3 arrows with the attributes right, up, and down and give the moving actor 3 new rules with the movements going right, up, and down

    Hope this helped
Sign In or Register to comment.