-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic Loader Update #83
Comments
Phaser json loader may do this for us if someone wants to look up the docs. We just might have to change our model slightly. Look up |
I'll be working on this. |
Updated config spriteSrc/imageKey values to be consistent with all of the other values (src/key). This simplifies polymorphism and saves byte size. Byte size matters in this case, since resources will eventually be sent via network requests. Won't be making a custom loader for reason stated in #91 |
Lets make the loader better. Presently we're loading sprites by referencing the src then hardcoding the key in whatever module we're using them from. Ideally we want to load the reference to the src and key! and not hard code anything at all.
In the config, lets not store all of the sprite references in the loader attribute, instead lets make a default.resources attribute. The loader should handle the resources and that's it. Here's a code example:
config.js
load.js
Now in any of our modules that need to create a sprite we can do this:
gameLoop.js
The tasks are:
config.default.graphicsResources
loadGraphics
above.The text was updated successfully, but these errors were encountered: