Do different events with every touch
delorean88@aol.com
Member Posts: 20
Here is my question. Lets say you have a stick figure person standing on a white background. You touch him and he waves and says hi, you touch him and he hops on one knee and says ouch, you touch him again and he falls over. Is there a way to do this? Right now I have something like this, but at the end of each event it loads another level and that next level has the one touch command. Can you have multiple touch commands on one actor to generate different responses? Any suggestion? Thanks in advance.
Comments
You can name an integer attribute 'event' with the value 1. Every time you press the actor, change attribute 'event' to attribute 'event' +1.
So, you touch it once, it goes to 2.
You touch it again, it becomes 3.
and so on.
Then, have a rule that says:
If 'event' = 1, do this action.
Then another rule:
If 'event' = 2, do this action
and so on and so forth.
You can even include a rule so that if you want just five different responses, it will go back to the first.
i.e. if 'event' is greater than 5, change attribute 'event' to 1.
These are great if you want a scripted sequence of events (i.e. 1, 2, 3, 4, 5). You can add the random feature to get a different random response.
Instead of changing the attribute event by +1, you'd put in the rule:
If actor is touched,
Change attribute 'event' to 'rand(1,5)
This chooses a random number from 1 to 5. You can keep the 'if event =2 then do this etc' rules.
Hope that helps,
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
"You can name an integer attribute 'event' with the value 1." How do I create an event like this? Do I name my actor "1"? I hope you are a patient person because I really want to understand this. Can you give me a step by step of just this first thing? Do I create a rule within my actor? Is it an attribute within my actor? Sorry...
http://gamesalad.com/game/play/79910
Try to see where everything is - the attributes are in the left panel, under the 'attributes' tabs (where the actors usually appear - just look a little above them for the tabs).
I've given some rudimentary instructions in each rule the actors have.
To download the file, right click the 'download' button on the example and save it somewhere.
Change the .game to .zip on the file.
Double click the .zip file
It should uncompress the file.
double click on the uncompressed file to open it up in GameSalad.
Good luck, Marty!
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
Thanks Again!!!!
M.M.
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io