Example
Example
Click on the example then click on a circle to set it off on it's journey (notice the three second delay).
Fully understand the concept by watching the tutorial in full screen at high res.
Once you have watched the video, you can refer to the code below to help you make your own that fits your game. Make sure you type it yourself to help you learn.
When making your game object, make sure it has a timer and that it is set to -1, which we will treat as being 'off'.
You can activate the timer at any time by setting it to any number (of seconds). This is shown in the checkCircleClicks() function.
Then, you can update the timer each frame like on the right. Instead of circle.moving = true, you can run any other code you wish when the timer expires.