spilgames / glue

Glue is a JavaScript game engine for making web games that run on desktop and touch devices.
glue-engine.com
Other
10 stars 4 forks source link

Add object right away to the game objects array #238

Open Marcolombo opened 10 years ago

Marcolombo commented 10 years ago

Right now if we want to add objects inside a loop, the init function will be loaded delayed, and the loop already changed indexes (or anything else) until the end (or at least, can't be predicted because of closures). We should be able to add an object instantly to the objects array, so we should shoot an event or at least call a different callback when initialized.