#Organizing Graphics for Game

20 messages · Page 1 of 1 (latest)

brave violet
#

I'm having trouble figuring out how to organize animations and player plugins. Could someone tell me if I went about the right way with this?
//Theres already stuff in place to change it to a more organized way but I can't think of a way that would be less messy

Player Plugin:
https://pastebin.com/YeS68y2h

Animate Plugin:
https://pastebin.com/Rx6TJi5F

#

Organizing Graphics for Game

hexed shell
#

It depends - why do you feel that you need to reorganize things at the moment?

To me, it seems like both files are fairly simple, contain things that are mostly cohesive, so I don't know that I would re-organize yet. I'd wait until things feel like they're just starting to be unwieldy, and reorganize then.

#

If I had to re organize now, it would mainly be to take the player file and turn it into a module with sub modules, and them have a file for each system. But given that it's so short a file, and the systems are currently fairly straightforward, I would wait with that

#

Just realized that as I was typing I had re-framed the question in my mind.... So here is a better response to your actual question:

To me, what you have seems good. I don't think there is a right way, organizing code is about making it easy for you to find what you need, understand what it's doing, and make adjustments to it. So long as you can do that, it's good.

brave violet
#

Oh ok

#

I was wondering If I should make an entirely new plugin to load all game assets

#

and then If I was going about animation wrong. Usually for people’s bevy projects i see people use an Animation component but I don’t really use that

brave violet
#

Like a way that allows me to load all assets on startup then assign the ones I need to the player, map, etc.

#

and then an animation component that just takes the player’s animations and uses them appropriately

#

also How do I flip the sprite?

#

multiplying the transform scale by -1 on the x should do that no?

hexed shell
#

Loading assets separately is a great next step - take a look at the bevy_asset_loader

#

As for flipping sprites, I believe the sprite component has properties for flipping x and flipping y, so I'd rely on that.

brave violet
#

oh ok thanks

brave violet
#

and flip_x = false also doesnt change it

#

nvm

#

fixed it