Is possible to get attribute when an actor is touched?

Hello i have two objects in my screen. When i touch it on the right doing some thing the game and if i touch in the left part of the screen that does another thing. But i would like to do rules in another actor with both actors play one or another part of the screen. I hope that everybody has understood me ;)

Regards from Spain :)

Comments

  • gamesfuagamesfua Member Posts: 723
    edited January 2013
    Not sure i understand. Are you saying that you want two actors to at some point be effected by a third actor? If so you can do that. Easiest way would be to use an attribute. For instance lets say we have three actors. One on the left. One the right. One on the top. If lets say you want the left and right actors to be destroyed when you tap the top actor- heres how you do it...

    Make an attribute, like a boolean.

    Put a rule in the top actor- when touch, change attribute boolean to true.
    Now put a rule in the other two actors. When attribute boolean is true- destroy.

    Now of course theres a bit more to it, but thats the basic idea.
    Is that helpful?
    Again i dont really understand the question. Let me know if this doesnt help. Best of luck!
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited January 2013

    Hi @RubiWorks

    I think I understand what you're after: is it this? >

    You have an actor on the left of the screen, lets call it ActorA, and if you press it, it does something in the game. You also have another actor on the right of the screen - let's call this one ActorB, and similarly, when this actor is touched, it will do something different in the game.

    But now you want a third actor, (called ActorC) which when touched, will randomly choose either ActorA or ActorB to perform their Rules.

    ---------

    If that's correct then the following would be one solution for you: make an integer attribute, call it Choose. Make its start value 2.

    In ActorC Rules, put:

    When Touch is pressed
    Change Attribute Choose to random(0,1)

    ----

    Now in the Rules of ActorA, add another Rule:

    When Choose=0
    Change Attribute Choose to 2
    ---your stuff to do

    ---and in the Rules of ActorB, add another Rule:

    When Choose=1
    Change Attribute Choose to 2
    ---your stuff to do

    Hope that helps.

    Edit: written same time as @anatomyofdreams was writing post...

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • gamesfuagamesfua Member Posts: 723
    edited January 2013
    Edit: @gyroscope thinks he's alllll fancy with his infinitely more detailed answer! ;)
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Edit: @gyroscope thinks he's alllll fancy with his infinitely more detailed answer! ;)
    Ha! :)) I'm a stickler for detail – I get on my own nerves sometimes...

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • RubiWorksRubiWorks Member Posts: 130
    edited January 2013
    Thanks @anatomyofdreams and @gyroscope but i have explained very badly my question. I want how can i make an attribute for example.

    When i touch the left screen i would can try to do an boolean that say "turn on/off" but i want to use in my game a attribute "when left screen is touched" then do "something". Not change all time the boolean with on or off.

    I tried with "Count Touch" but i don´t like ;)
  • gamesfuagamesfua Member Posts: 723
    The boolean or any other type of attribute you use, is what will allow you to control other actors/objects.
    For instance think of a touch control joystick on the screen. When you tap the up button your main character moves up. Well thats all done with attributes. And you can see how they work from the examples gyroscope and myself gave.
    If however that is not your question- unfortunately the question isn't translating over to english well. Perhaps you can get it translated to english or maybe write it in your native language- and someone who knows your language can help out.
    Hope this helps! :)

    By the way, i love your icon!
Sign In or Register to comment.