Multiple Touch Question
Whats the best way to work this? I'm writing this from the top of my head - and believe this is how it works...
I have a door.
If you touch the door it unlocks.
If you touch the unlocked door it opens.
If you touch the opened door you enter it.
The problem being that a single touch unlocks, opens and enters the door because it registers all events and changing attributes pretty much instantaneously.
So do I use timers so that there's a pause between registering a second touch? Or is there a better way?
I have a door.
If you touch the door it unlocks.
If you touch the unlocked door it opens.
If you touch the opened door you enter it.
The problem being that a single touch unlocks, opens and enters the door because it registers all events and changing attributes pretty much instantaneously.
So do I use timers so that there's a pause between registering a second touch? Or is there a better way?
Comments
For example:
game.sequence = 0
When door is touched, change game.sequence to 1
(This unlocks door)
When game.sequence = 1
When door is touched change game.sequence to 2
(Unlocked door opens)
Better yet make those attributes self.sequence
________________________________________________________________________
LIKE us on Facebook and Follow us on Twitter! :
Blackbird Studios Facebook Page
Blackbird Studios Twitter
Yeah thinking about it I think that works and my question actually really should be this:
Slightly different scenario:
I have a door, behind the door is a key. (2 seperate actors).
Touch door to open it (changes integer door attribute from 0 to 1)
Touch key to pick it up (key can only be picked up when door attribute = 1)
However the problem is that because the touch on the door changes the door attribute =1. The key is instantly picked up too with a single touch. In fact you barely get to see there's a key there because the door opens and the key is collected instantaneously.
So does the key need to have a timer to delay it from accepting a touch once the door has been opened? Or does anyone know a better way?
The key cannot be picked up until game.keypickup =1
Touch door to open it (door attribute changes from 0 to 1)
Then say (in the door's rules) when touch is released AND door attribute =1, change game.keypickup to 1
(for key: when touch is pressed AND keypickup=1, then pick up the key)
That should work.
-Matt
________________________________________________________________________
LIKE us on Facebook and Follow us on Twitter! :
Blackbird Studios Facebook Page
Blackbird Studios Twitter
Sounds good - I'll try this out when I next get a chance but think that should do the trick!
Cheers
-Matt
________________________________________________________________________
LIKE us on Facebook and Follow us on Twitter! :
Blackbird Studios Facebook Page
Blackbird Studios Twitter