Actors and behavior on pressed

TitamTitam Member Posts: 20
edited June 2012 in Working with GS (Mac)
Hi there,

A little issue I can't fix, example to understand :
I have a Button (actor1). I click on actor1, hop, a new actor (Actor1) is called, in front of Actor1. I want to push on actor2, but the behavior for actor1 is called also. How to "deactivate" the actor1 behavior in this case to avoid every pression to run the rule on this actor1 which is behind (physically) actor2 ? ^^

If it's not clear, I can make a draw ;)

Thanks !

Best Answer

  • MotherHooseMotherHoose Posts: 2,456
    Accepted Answer
    when: actor1 … has spawned actor2 …
    what: tell computer actor1 is done responding to touch

    on actor1 add:
    actorAttribute … boolean type … done

    Rule: when
    Event: touch is pressed
    Attribute: self.done is false
    -Spawn actor2
    -changeAttribute: self.done To: true

    then actor1 will do nothing when touch is pressed again
    … you can always change self.done to false again with a timer or another rule

    image MH

Answers

  • TitamTitam Member Posts: 20
    edited June 2012
    I always forget about actor's attribute !
    Thanks !!
Sign In or Register to comment.