hi there!
I’m hitting an obstacle here: I have six disks on screen, and users can touch and rotate these discs (by moving there finger around once they have started their touch on one of these discs).
I’m using multitouch, and the problem is that I want to know which disc needs to stop spinning when a certain touch ends. It would be great if at the start of a touch event (using multitouch, by the way) I could say something like “if event.phase == “began” then event.discTouched = 3” but unfortunately the event parameter is local to that if…then statement, so at the event.phase == “ended” point the variable event.discTouched is nil!
For complicated reasons I can’t use the event.target parameter, so unfortunately this won’t help, and I’m really in the situation where I would like to “stuff” extra info in the touch event table myself. If I don’t do this I will need to do a for-loop over all of my active touch-events which would slow down my code and seems like crappy logic.
So, does anybody know if this is possible somehow? Logically, if I could declare this variable ( let’s say ‘event.extraInfo’ ) at the start of my function that handles touch events, it would be in scope for everything in this function, but there is no way to declare it without setting it, and if I set it I always overwrite the data in it, which is obviously of no use.
cheers,
Thomas
p.s. It’s been a long time since I was on this forum - after 6 months of no time to code I finally started work on my second game app. It’s good to be back! [import]uid: 70134 topic_id: 34034 reply_id: 334034[/import]