Skip to content

Key.duration initial value not 0 in v2.0.5 #932

@DrHackenstein

Description

@DrHackenstein

Key.duration should be "the number of milliseconds this key has been held down for." with default value 0. However I've found that the inital value before the key has been pushed is in fact something else >0. Not sure how that happens, but it's easy to test by printing out the value:

var key = this.keyboard.addKey(Phaser.Keyboard.SPACEBAR);
update()
{
console.log("Duration: " + key.duration);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions