How can I do this?

FeluciFeluci Member Posts: 35
edited November -1 in Working with GS (Mac)
Hello,

I want Actors do to something when Actor A is pressed twice. But it must be repeatable. So When actor A is pressed change attribute Actor A to Actor A +1 wont do. It must be something like If attribute Actor A=Actor A+2 change Actor B to blabla But i tried and it didnt work.

Hope you know what i mean

Comments

  • mlaftamlafta Member Posts: 147
    Please explain more..
  • ShaneS429ShaneS429 Member Posts: 77
    Not exactly sure if I understand you but you want Actor A to get pressed twice, after which, it will change or trigger something else, and then it Actor A can be pressed twice again to repeat the action as before?

    If so..

    Actor A:
    Rule: Actor - touch - Pressed
    Change Attribute: PressCount = PressCount + 1

    Rule: If PressCount = 2
    *Change or Trigger whatever action you want*
    PressCount = 0

    That should work, I'm new to GS myself but trying to help whenever I can.
  • gazjmgazjm Member Posts: 578
    in your example, it isn't working because actor A can never = actorA+2, as it will always be 2 more than its own value.

    I would have an integer attribute, say, counter. which when actorA is pressed has counter = counter + 1

    If counter = 2 perform the rule on actor B, then have a change attribute to change count to 0. This will ensure it alway counts to 2 max, and is repeatable

    Edit: beaten to it! Same logic though!.
  • FeluciFeluci Member Posts: 35
    Thanks for the replies.
    But it's not really what i mean. Ill try to explain more.

    Let's say when Actor B is pressed it will change color when Actor A is pressed twice.

    Then you press Actor A once

    But then you press Actor C that will also change color when Actor A is pressed twice

    So then you press Actor A again and then Actor B will change color. But Actor C wont change color untill you press Actor A again because that will be the second press for Actor C
  • gazjmgazjm Member Posts: 578
    you have to have each actor have an attribute for each actor to say of it's active.

    have an attribute called Colouractive, set to 0

    Also have attributes called actorBpressed and actorCpressed, set to 0

    if actorB receives a touch change colouractive to 1
    Then in actorA have a rule which says
    If touch is pressed and colouractive = 1 then actorBpressed = actorBpressed +1

    if actorC receives a touch change colouractive to 2
    Then in actorA have a rule which says
    If touch is pressed and colouractive = 2 then actorCpressed = actorCpressed +1

    That's should be a start for you but without seeing the game can't really expand more.
  • ShaneS429ShaneS429 Member Posts: 77
    I just spend like 10minutes trying to read that and understand it, and I'm lost.

    Are you saying...

    2 Presses on Actor A will change Actor B or Actors Cs color

    But, Actor B or C needs to be pressed first to "activate" it to receive the press counts from A?
  • mlaftamlafta Member Posts: 147
    Not sure I understand but here is a thought for you.

    Create global attributes to control what you want, this will be accessible by all actors because it's game wide attributes. Within each actor create rules do what you want based on the global attributes values you created and also change the values so other actors would know what to do.

    M
  • FeluciFeluci Member Posts: 35
    Ok thanks got it :D
Sign In or Register to comment.