-
Notifications
You must be signed in to change notification settings - Fork 32
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
Spawn items support #120
Spawn items support #120
Conversation
c576ba1
to
ae35d77
Compare
@zicklag Do you know why the AssetLoader is not invoked at all in this branch (here)? I've put everything in place, but assets under /items/ are ignored. I've tried to figure out what triggers a load, but looking at fighters for example, doesn't seems to lead to any explicit loading code (so I take there's an implicit load somewhere). |
You need to load them as a part of the level load with another block like this one: |
Ah! I need to do all the manual load 😳 I'll try this, thanks 😄 |
No, you have to do it in the Level asset loader. The level asset loader is responsible for telling the asset server that it depends on the item assets ( which is why your item asset loader wasn't getting run ), and for setting the item handles to their actual handles in the level metadata, otherwise they will default to null handles. Edit:
Yep. :) |
Nice in principle, but currently unused.
ae35d77
to
7a509c3
Compare
@erlend-sh CC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
I like your attention to code style and quality and improvement. 👍
Add spawn items support:
The level loading (
main.rs#load_items
) follows the pattern of loading items metadata, then separately instantiating them.I've removed the
Pickable
component, since until now, it serves no purpose. It may be reinstantiated.I've also done some refactoring in the
assets.rs
module, consistently using the convenience loading API that was used only a few times.This PR addresses the first entry in #83.