ASU-CodeDevils / CD-GameDev

A game made in Rust.
1 stars 0 forks source link

Create animation system #2

Open Remi-Godin opened 1 week ago

Remi-Godin commented 1 week ago

Create a Bevy plugin to facilitate handling animations from sprite sheets. Most sprite sheets contain multiple animations, and we should be able to play each of them whenever we want, and even mix and match frames to create new ones if possible. Once an animation is defined, it should be saved in a collection of sort that we can then go through and select which one to play at any given time.

See this example from the official Bevy examples to see how sprite animation works. In the example, you can see that the texture atlas (or sprite sheet) is broken down into a TextureAtlasLayout, which is saved in the asset server. On the character, there is a TextureAtlas component that references that TextureAtlasLayout. In the animate_sprite system, we query the TextureAtlas component and the index is changed every time the timer has completed a cycle.

The goal here would be to have a component we can add to our sprites which will play the selected animation continuously, at the desired speed. Animation selection would be driven by external events outside this plugin.

Requirements:

Stretch goals:

4pt1y commented 1 week ago

Hey bossman, I'd love to give this a shot.

**edit: do we wait for you to assign or do we self-assign?

Remi-Godin commented 1 week ago

You got it :sunglasses:

4pt1y commented 1 week ago

Thanks! I'm scared and excited. :D

4pt1y commented 1 day ago

Removed myself as assignee on the issue...sorry everyone, I am out of my depth on this one. I'll absolutely hop on another issue in the future but I just need to learn more about Rust/Bevy first.