Lab: Animated Character
If you have an engine in progress already, try to build this on top of that. It could save you some time later!
- Set up an Animation data type; it could store a vec of frame indices or rectangles (sections of the spritesheet) and a vec of frame timings, along with a boolean indicating whether this animation loops; or you could set it up another way (perhaps as a paperdoll animation, or even do both!).
- Create or find a spritesheet image, then set up at least three looping animations and one one-shot animation by constructing values of your Animation type and putting them into an array.
- Or make a paperdoll animation
For full credit, do one of the following:
- Animation Viewer:
- Make it so that pressing left and right arrow keys cycle between different animations in your animation data.
- Then, progress the animations over time; your animation data format should define how many frames an animation frame lasts for.
- Finally, use the up and down arrow keys to increase or decrease a time scaling factor to make the animations run faster or slower.
- Try to add other fun features: if you want to draw all the character's different animations side by side, or have animations automatically transition into other animations, or something else that might be useful or cool.
- Animated Character:
- Make your character move around in two dimensions with the arrow keys, or one dimension plus jumping
- Have your character play different animations in different circumstances (accelerating either in or against the current direction of motion, falling, jumping, striking a cool pose, braking to a stop, et cetera)
- Try to make it feel cool!