mirror of
https://github.com/photonstorm/phaser
synced 2024-11-27 15:12:18 +00:00
Added KeyCombo.progress.
This commit is contained in:
parent
fa69035e4f
commit
226e0b216d
1 changed files with 17 additions and 1 deletions
|
@ -4,7 +4,7 @@ var ProcessKeyCombo = require('./ProcessKeyCombo');
|
|||
var KeyComboMatchEvent = require('./KeyComboMatchEvent');
|
||||
|
||||
// Keys can be either:
|
||||
//
|
||||
//
|
||||
// A string (ATARI)
|
||||
// An array of either integers (key codes) or strings, or a mixture of both
|
||||
// An array of objects (such as Key objects) with a public 'keyCode' property
|
||||
|
@ -123,4 +123,20 @@ KeyCombo.prototype = {
|
|||
|
||||
};
|
||||
|
||||
Object.defineProperties(KeyCombo.prototype, {
|
||||
|
||||
progress: {
|
||||
|
||||
enumerable: true,
|
||||
|
||||
// How far complete is this combo? A value between 0 and 1.
|
||||
get: function ()
|
||||
{
|
||||
return this.index / this.size;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
module.exports = KeyCombo;
|
||||
|
|
Loading…
Reference in a new issue