lemunozm / ruscii

Terminal graphics engine: build your games in the terminal!
Apache License 2.0
171 stars 15 forks source link

Ruscii animation #37

Closed luisfbl closed 1 year ago

luisfbl commented 1 year ago

Hey, I'm new with rust and I'm really enjoying this experience with ruscii. Currently was added the feature "animation" and it didn't work the way I thought. Can you explain me better? I was thinking this would be a transition from x/y to another position, this way is more functional then the spaces in text (I think):

let animation = vec![
    AnimationFrame::new("X  ", 1),
    AnimationFrame::new(" X ", 1),
    AnimationFrame::new("  X", 1),
    AnimationFrame::new(" X ", 1),
];
lemunozm commented 1 year ago

cc @pumken

lemunozm commented 1 year ago

As I understand, these kinds of animations are a change in the image. In the same way, a GIF animation does not move the gif over the screen, an ASCII animation is performed in a fixed position. The idea in mind is to perform multiple ASCII changes, modifying several chars at once per frame.

If you want to make a transition, you can move x and y using the pencil. That could be another great kind of animation to build, one that uses the pencil along with coordinate transformations. By now, there is no higher abstraction for that, and you need to move the pencil manually to get that behavior.

pumken commented 1 year ago

Thanks for the feedback, @oluiss !

I think we can change this so that each AnimationFrame has a delta Vec2 to translate the frame across the screen.

This would also work pretty well with having animations with variable height. I'll start working on this soon!

luisfbl commented 1 year ago

Thanks @lemunozm and @pumken for the quick reply, I think I understand, if I can contribute anything you can call me.