How can I improve my Animation
- by sharethis
The first approaches in animation for my game relied mostly on sine and cosine functions with the time as parameter.
Here is an example of a very basic jump I implemented.
if(jumping)
{
height = sin(time);
if(height < 0) jumping = false; // player landed
player.position.z = height;
}
if(keydown(SPACE) && !jumping)
{
jumping = true;
time = now(); // store the starting time
}
So my player jumped in a perfect sine function. That seems quite natural, because he slows down when he reached the top position, and in the fall he speeds up again. But patching every animation out of sine and cosine is stretched to its limits soon.
So can I improve my animation and provide a more abstract layer?