Is possible to get attribute when an actor is touched?
RubiWorks
Member Posts: 130
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
Regards from Spain
Comments
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!
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
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
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
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!