File tree 1 file changed +3
-3
lines changed
packages/melonjs/src/renderable
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -315,7 +315,7 @@ export default class Sprite extends Renderable {
315
315
/**
316
316
* make the object flicker
317
317
* @param {number } duration - expressed in milliseconds
318
- * @param {Function } callback - Function to call when flickering ends
318
+ * @param {Function } [ callback] - Function to call when flickering ends
319
319
* @returns {Sprite } Reference to this object for method chaining
320
320
* @example
321
321
* // make the object flicker for 1 second
@@ -324,11 +324,11 @@ export default class Sprite extends Renderable {
324
324
* world.removeChild(this);
325
325
* });
326
326
*/
327
- flicker ( duration , callback ) {
327
+ flicker ( duration , callback = undefined ) {
328
328
this . _flicker . duration = duration ;
329
329
if ( this . _flicker . duration <= 0 ) {
330
330
this . _flicker . isFlickering = false ;
331
- this . _flicker . callback = null ;
331
+ this . _flicker . callback = undefined ;
332
332
} else if ( ! this . _flicker . isFlickering ) {
333
333
this . _flicker . callback = callback ;
334
334
this . _flicker . isFlickering = true ;
You can’t perform that action at this time.
0 commit comments