In fighting game, there is an important thing called input buffering. When your character is doing an action, you can input the next action that will activate as soon as possible (the buffer is 5-10 frames).
Has anyone already implemented, or knows the most efficient way to do this?
I thought of things like this:
Enum list moves (a list of all my moves)
if (moves = fireball)
{
if (Mycharacterisidle)
{
Do the fireball
}
else if (MycharacterisMoving)
{
if (lastspriteisnotfinished)
{
InputBuffer++;
}
else if(spriteisfinished && InputBuffer < 5)
{
Do the fireball
}
}
}
Any better ideas? Thx.
No comments:
Post a Comment