Custom events and scheduled events
With the new version of WADE you can define your own custom events, simply by listening to them:
Then fire this event and the 'myCustomEvent' function of the listeners (or of any behaviors of the listeners) will be executed:
But things get even more interesting as you schedule your custom events, so for example you could do this:
Which would cause the 'fire' function of the spaceship object to be executed after 1000 milliseconds, unless the spaceship is removed from the scene in the meantime, in which case the scheduled event is automatically cancelled.