Skip to content
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

Implement First Pass Scene Assets #22

Merged
merged 1 commit into from
Jun 29, 2022

Conversation

zicklag
Copy link
Member

@zicklag zicklag commented Jun 29, 2022

This removes all the hard-coding for the scene spawning. Everything is loaded from assets.

I co-located the sprites for the fighters with the fighter YAML, but they could just as well be moved to a separate sprites folder if we wanted. It's setup so that when one asset references another asset the path is relative to the current file by default, but paths starting with a / are relative to the asset directory instead.

If we continue to put everything in assets, such as the UI theme images, etc. that are all referenced by a central .game.yaml, then the cool part is that the game becomes like a "punchy engine" where anybody can bring their own .game.yaml and totally change the feel and theme of the game.

This isn't implemented yet, but it's easy to do: you can even hook the web build of the game up so that you can use a query string to specify the asset URL to your own punchy game that you host on GitHub pages, making it a punchy game web player, and anybody can just host their assets on GitHub and then send people a link to play it with the punchy web player.

@zicklag zicklag mentioned this pull request Jun 29, 2022
@zicklag zicklag force-pushed the scene-impl-first-pass branch from 7d0be7d to 657b553 Compare June 29, 2022 00:44
@odecay
Copy link
Collaborator

odecay commented Jun 29, 2022

Started looking it over. Looks good so far.
Could you explain the metadata?

Copy link
Collaborator

@odecay odecay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay looking really nice, On 2nd look I see what the metadata is.
Loading and spawning different entity types will be much simplified from what it was and the yaml files are nice and readable.

src/camera.rs Outdated Show resolved Hide resolved
src/main.rs Outdated Show resolved Hide resolved
src/movement.rs Outdated Show resolved Hide resolved
src/main.rs Outdated Show resolved Hide resolved
@erlend-sh
Copy link
Member

erlend-sh commented Jun 29, 2022

the cool part is that the game becomes like a "punchy engine" where anybody can bring their own .game.yaml and totally change the feel and theme of the game.

That’s definitely the direction we wanna be going with. We also have plans to incorporate https://github.com/makspll/bevy_mod_scripting after Bevy v0.8

@zicklag
Copy link
Member Author

zicklag commented Jun 29, 2022

We also have plans to incorporate https://github.com/makspll/bevy_mod_scripting after Bevy v0.8

What! Bevy gotten a scripting plugin while I'd been gone! Looks like the ecosystem's grown up quite a bit since half-way through the Bevy 0.5 era. :)

I'm going to have to look at that.


I could see a case for not doing it this way because of rightward drift but it seems more straightforward.

Yeah, I'm fine either way. I've developed a habit of doing it like that to avoid rightward drift because I've ended up needing a lot of those in my own code before, but you're right that it's not really a problem here.

I asked about the pattern on the forum and they said eventually we should be able to shorten it to let Some(variable) = option else { return; }.

I'll push an update to apply all your suggestions.

@zicklag zicklag force-pushed the scene-impl-first-pass branch from 657b553 to b2eedad Compare June 29, 2022 14:37
@zicklag zicklag requested a review from odecay June 29, 2022 14:37
@odecay odecay merged commit f5dc3fe into fishfolk:master Jun 29, 2022
@zicklag zicklag deleted the scene-impl-first-pass branch June 29, 2022 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants