I'm having an problem with a timer. together with some other student we're making an adaption of a mouse event based Memory game.
Whe changed the code so that it will response to a color tracking event. Now for it to work smoothly it should start the flip animation after the timer had finished. However I'm getting back strange value's from the timer.
Its the timer provided by:
Learning Processing
Daniel Shiffman
http://www.learningprocessing.com Example 10-5: Object-oriented timer
The values im getting in return from println (timer); are:
Femi$Timer@578dfb
Femi$Timer@88b1e6
and so one.
Now even I can understand that the timer will never reach the limit of 5000 ms. So my event will never start.
What can I do to solve this problem. Make my on timer with some kind of iteration? Or am I on the right track but implementing it wrong?
The project is programmed OOP but for this forum Ive putted all the code together in one file. The resolutions are off so there are some memory blocks missing. But that isn't the bug I want to get rid of. (I could only copy the project from my classmates in this resolution or it wouldn't work). The timer to finish so my animation can start is the bug.
Thanks in advance
P.S. you got to use a red object for the tracking to work.
Line 174 should start when line 171 is finished. But with this timer value it never reaches 5000
The code is: