Sunday, October 30, 2016

xna - Fighting Game and input buffering


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

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...