Skip to content

Commit

Permalink
unify scene left method
Browse files Browse the repository at this point in the history
  • Loading branch information
Gummibeer committed Jan 23, 2017
1 parent 07e3092 commit ca5fdd9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
15 changes: 8 additions & 7 deletions src/js/scenes/engine/phaser/credits.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
var Credit = function (game) {
this.background = null;
this.text = null;
this.keys = {};
};
Credit.prototype = {
create: function () {
this.background = this.add.sprite(this.game.world.centerX, this.game.world.centerY, 'credits');
this.background.anchor.setTo(0.5, 0.5);
this.background.width = this.game.world.width;
this.background.height = this.game.world.height;

this.game.input.keyboard.addKeyCapture([Phaser.Keyboard.ESC]);
this.keys.esc = this.game.input.keyboard.addKey(Phaser.Keyboard.ESC);
},
update: function () {
if (this.keys.esc.isDown || this.game.input.activePointer.isDown) {
this.game.state.clearCurrentState();
var that = this;
if(this.game.input.activePointer.isDown) {
this.game.state.start('Menu');
return true;
}
this.game.input.keyboard.onPressCallback = function () {
that.game.state.start('Menu');
}
},
shutdown: function () {
this.game.input.keyboard.onPressCallback = null;
}
};
1 change: 0 additions & 1 deletion src/js/scenes/engine/phaser/intro.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Intro.prototype = {
create: function () {
this.video = null;
this.video = this.game.add.video('intro');
var oHeight = this.video.height;
this.video.addToWorld(this.game.world.centerX, this.game.world.centerY, 0.5, 0.5, this.game.world.height/this.video.height, this.game.world.height/this.video.height);
this.video.onComplete.addOnce(this.videoEnd, this);
this.video.play();
Expand Down

0 comments on commit ca5fdd9

Please sign in to comment.