@@ -382,10 +382,6 @@ Phaser.Timer.prototype = {
382382 return true ;
383383 }
384384
385- if ( time < this . _now )
386- {
387- console . log ( 'time travel?' , time , this . _now = time ) ;
388- }
389385 this . _now = time ;
390386 this . _marked = 0 ;
391387
@@ -461,18 +457,13 @@ Phaser.Timer.prototype = {
461457 */
462458 pause : function ( ) {
463459
464- console . log ( 'Timer.pause called' ) ;
465-
466460 if ( this . paused )
467461 {
468- console . log ( 'Already paused, aborting' ) ;
469462 return ;
470463 }
471464
472465 this . _pauseStarted = this . game . time . now ;
473466
474- console . log ( 'paused duration' , this . duration ) ;
475-
476467 this . paused = true ;
477468 this . _codePaused = true ;
478469
@@ -485,11 +476,8 @@ Phaser.Timer.prototype = {
485476 */
486477 _pause : function ( ) {
487478
488- console . log ( 'Timer._pause called' ) ;
489-
490479 if ( this . paused )
491480 {
492- console . log ( 'Already paused, aborting' ) ;
493481 return ;
494482 }
495483
@@ -506,23 +494,14 @@ Phaser.Timer.prototype = {
506494 */
507495 resume : function ( ) {
508496
509- console . log ( 'Timer.resume called' ) ;
510-
511497 if ( ! this . paused )
512498 {
513- console . log ( 'No longer paused, aborting' ) ;
514499 return ;
515500 }
516501
517- // var durationBeforePause = this.duration;
518-
519- // console.log('old duration', durationBeforePause);
520-
521502 this . _pauseTotal += this . game . time . pauseDuration ;
522503 this . _now = this . game . time . time ;
523504
524- console . log ( 'paused for' , this . game . time . pauseDuration ) ;
525-
526505 for ( var i = 0 ; i < this . events . length ; i ++ )
527506 {
528507 if ( ! this . events [ i ] . pendingDelete )
@@ -537,13 +516,9 @@ Phaser.Timer.prototype = {
537516
538517 // Add the difference on to the time now
539518 this . events [ i ] . tick = this . _now + t ;
540-
541- console . log ( 'event increased by' , t ) ;
542519 }
543520 }
544521
545- // this.nextTick = this._now + durationBeforePause;
546-
547522 var d = this . nextTick - this . _pauseStarted ;
548523
549524 if ( d < 0 )
@@ -555,29 +530,6 @@ Phaser.Timer.prototype = {
555530 this . nextTick = this . _now + d ;
556531 }
557532
558- console . log ( 'nextTick +' , d ) ;
559-
560-
561- // if (this.nextTick > this._now)
562- // {
563- // // event was going to tick in the future, but we need to add the time it was paused to it
564- // d = this.nextTick - this._now;
565- // t = this.game.time.pauseDuration;
566- // this.nextTick += t;
567- // console.log('next tick was going to tick in the future', t);
568- // }
569- // else
570- // {
571- // // event tick time has elapsed due to pause
572- // d = this._now - this.nextTick; //
573- // // t = this.game.time.pauseDuration - d;
574- // t = this.game.time.pauseDuration;
575- // this.nextTick += t;
576- // console.log('next tick has elapsed behind game time by', t);
577- // }
578-
579- console . log ( 'new duration' , this . duration ) ;
580-
581533 this . paused = false ;
582534 this . _codePaused = false ;
583535
@@ -590,16 +542,12 @@ Phaser.Timer.prototype = {
590542 */
591543 _resume : function ( ) {
592544
593- console . log ( 'Timer._resume called' ) ;
594-
595545 if ( this . _codePaused )
596546 {
597- console . log ( 'code paused' ) ;
598547 return ;
599548 }
600549 else
601550 {
602- console . log ( 'normal resume' ) ;
603551 this . resume ( ) ;
604552 }
605553
0 commit comments