How can I improve my Animation
Posted
by
sharethis
on Game Development
See other posts from Game Development
or by sharethis
Published on 2012-12-15T11:31:25Z
Indexed on
2012/12/16
11:28 UTC
Read the original article
Hit count: 273
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?
© Game Development or respective owner