ippa / jaws

Jaws - HTML5 canvas javascript 2D Game Framework
https://jawsjs.ippa.se
GNU Lesser General Public License v3.0
364 stars 75 forks source link

jaws.Assets() Arrays vs. Objects #115

Open atomdmac opened 10 years ago

atomdmac commented 10 years ago

I've been looking at the source for jaws.Assets and noticed that, although the "loaded", "loading" and "data" properties of the Assets() instance are defined as Arrays, they seem to be treated as Objects (i.e. "associative arrays" rather than indexed numerically).

My questions are: 1) What is the rationale behind defining these as Arrays rather than plain Objects/hashes? Are there any advantages to doing it this way? 2) When using multiple instances of jaws.Assets(), I've had trouble getting my onload() handlers to fire (when passed in as an option to loadAll()). Does anyone else have experience with using multiple instances of the assets loader?