* make the object flicker * @param {number} duration - expressed in milliseconds * @param {Function} [callback] - Function to call when flickering ends * @returns {Sprite} Reference to this object for method chaining * @example * // make the object flicker for 1 second * // and then remo
(duration, callback = undefined)
| 473 | * }); |
| 474 | */ |
| 475 | flicker(duration, callback = undefined) { |
| 476 | this._flicker.duration = duration; |
| 477 | if (this._flicker.duration <= 0) { |
| 478 | this._flicker.isFlickering = false; |
| 479 | this._flicker.callback = undefined; |
| 480 | this._flicker.elapsed = 0; |
| 481 | } else { |
| 482 | this._flicker.callback = callback; |
| 483 | this._flicker.elapsed = 0; |
| 484 | this._flicker.isFlickering = true; |
| 485 | } |
| 486 | return this; |
| 487 | } |
| 488 | |
| 489 | /** |
| 490 | * add an animation <br> |
no outgoing calls
no test coverage detected