calculating time between touch pressed and touch released?
![joelE](http://forums.gamesalad.com/applications/dashboard/design/images/defaulticon.png)
is it possible to calculate the time between touch pressed and touch released.
i have tried constraining self.time to 0 but cant work out how to get it to start when touch is pressed.
any help would be great and perhaps prevent me from launching the mac off the roof of my building....I already have a target set up with flashing lights and a bullseye.
i have tried constraining self.time to 0 but cant work out how to get it to start when touch is pressed.
any help would be great and perhaps prevent me from launching the mac off the roof of my building....I already have a target set up with flashing lights and a bullseye.
Comments
I've not played around with the game time hugely but I'm guessing this would work:
Create a real attribute called timeStart, one called timeEnd and one called timeTotal then when touch is pressed change attribute timeStart to game.time then when touch is released change attribute timeEnd to game.time and then set a timer after 0.05 seconds (this is so it registers the end attribute in time) change attribute timeTotal to timeStart - timeEnd.
Now timeTotal is how long the user had their finger touched
Ace
This way you can miss out the timer and avoid misstriggers.
Ace
i'll give it a go,
I've also added a pa system with a fanfare should this not be the solution.
Ace
controlling time is a bitch.
I'm gonna go and crack my head on the sink and see if that musters up any ideas.
would it matter if i created self attributes and controlled the actors time rather than the game time?
I mean i've done this and it made no difference so not sure why i'm asking really. desperation i suppose.
Ace
I solved it:
http://ellerker.net/files/Touch Release.gameproj.zip
Ace
Ace
Bring your Guitar aswell and we'll crank out some warrent! haha.
Thanks a pant load for your help on this. the example file is great, i appreciate the time. now if you will excuse me Brandy and Megan require my service.
Not a problem buddy... Any time
Ace
This is exactly what Ive been looking for and trying to figure out.
my productivity is back on track .