mirror of
https://github.com/ysoftdevs/pf2016.git
synced 2026-03-17 23:04:24 +01:00
delay displaying next button
This commit is contained in:
@@ -336,13 +336,24 @@ state.checkCollision = function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (((Math.round(positionX/64) == Math.round(this.finishMarker.x/64) )) && (Math.round(positionY/64) == Math.round(this.finishMarker.y/64))) {
|
if (((Math.round(positionX/64) == Math.round(this.finishMarker.x/64) )) && (Math.round(positionY/64) == Math.round(this.finishMarker.y/64))) {
|
||||||
this.stageState = 'complete';
|
this.stageComplete();
|
||||||
this.myButton.text = 'Next'
|
|
||||||
this.addChild( this.myButtonSprite );
|
|
||||||
this.addChild( this.myButton );
|
|
||||||
|
|
||||||
this.character.physics.velocity.x = 0;
|
|
||||||
this.character.physics.velocity.y = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
state.displayCongratulation = function() {
|
||||||
|
this.myButton.text = 'Next'
|
||||||
|
this.addChild( this.myButtonSprite );
|
||||||
|
this.addChild( this.myButton );
|
||||||
|
}
|
||||||
|
|
||||||
|
state.stageComplete = function() {
|
||||||
|
this.stageState = 'complete';
|
||||||
|
|
||||||
|
this.timer = this.game.time.clock.createTimer('time', 1, 1, true);
|
||||||
|
|
||||||
|
this.timer.createTimerEvent( Kiwi.Time.TimerEvent.TIMER_STOP, this.displayCongratulation, this );
|
||||||
|
|
||||||
|
this.character.physics.velocity.x = 0;
|
||||||
|
this.character.physics.velocity.y = 0;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user