Hi all, I’ve got an irritating problem occurring with my code and Director class.
I’ve got some basic controls i’ve created to move a character left right, changing the x values for the image/character i’ve created.
I’ve also got a countdown timer which when it gets to zero changes scenes automatically.
Everything works great but when the timer gets to zero and a finger is still touching the screen it causes an error because it was still trying to move my character, the screen still changes but weird things occur afterwards because of the error.
The error: attempt to perform arithmetic on field ‘x’ (a nil value)
Which I understand why its happening but can’t think of a graceful solution. The only one I’ve created so far is to watch the clock and disable the controls with one second to go but this is still ineffective if you just rest your finger on the screen.
So I think i’m looking for a way to override all touch events when the the clock hits zero.
Can anyone help?
[import]uid: 33866 topic_id: 7311 reply_id: 307311[/import]