-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
Possibility to transfer the current_frame field between animations #168
Comments
I honestly think that I think I'd prefer the fn current_frame(&self) -> usize { ... }
fn set_current_frame(&mut self, index: usize) { ... } I'd lean towards having Also, as an aside - that GIF looks very cool :) Are you making a Factorio-like kind of game? |
Also, another side note: the source code for |
I'm using the factorio assets for development.
Maybe it's an idea to make a seperate crate, e.g. |
Yeah, I'm considering doing something like this eventually :) |
In a game I'm making I have several animations that are needed for animating a player's character whenever they're moving in a certain direction. Whenever a player switches direction by pressing a different combination of arrow keys, a new animation gets selected.
Code
Because the walking animation is relatively long, it is very noticeable that the animation gets
.restart()
every time a player switches directions. If I get rid of.restart()
, the animation becomes even more irregular.I'd suggest one of two things:
fn copy_frame_index(&mut self, other: &Animation)
which copies both thecurrent_frame
andtimer
frame_length
orframes.len()
is different?Whenever we decide on an API, I can make a PR
The text was updated successfully, but these errors were encountered: