Skip to content

Add input buffering, I.E.: track time since pressed #13

@Geokureli

Description

@Geokureli

Example

If the player presses jump a few frames before landing, the player character should jump as though it was pressed just after landing

Rough Proposal

if (player.isOnGround() && controls.justPressedBuffer(0.1, JUMP)) // or justPressed.buffer(0.1).DOWN
{
    player.jump();
}

and/or

if (player.isOnGround() && controls.timeSinceJustPressed(JUMP) < 0.1) // or justPressed.timeSince.DOWN
{
    player.jump();
}

Accuracy for Rhythm games

The simple way to do this is to set a timer to 0 when it's pressed and add elapsed each frame, which would make this deterministic when the timestep is fixed, but maybe we can be accurate? This is probably WAY out of scope for this task, but can we track how long ago they ACTUALLY pressed it, assuming that info is available on certain targets. This would allow incredible input accuracy even when on low fps

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions