Add: God's next chocoball
This commit is contained in:
@@ -3,6 +3,7 @@ God = function(x, y, mainGame) {
|
||||
this.isActivated = true;
|
||||
|
||||
Phaser.Sprite.call(this, game, x, y, 'god_angry');
|
||||
// this.anchor.setTo(0.5, 1);
|
||||
this.anchor.setTo(0.5, 1);
|
||||
this.scale.set(0.5);
|
||||
|
||||
@@ -11,6 +12,8 @@ God = function(x, y, mainGame) {
|
||||
// this.events.onInputDown.add(this.onDown, this);
|
||||
|
||||
game.add.existing(this);
|
||||
|
||||
this.smileAgain();
|
||||
}
|
||||
|
||||
God.prototype = Object.create(Phaser.Sprite.prototype);
|
||||
@@ -40,10 +43,10 @@ God.prototype.setScale = function(size) {
|
||||
|
||||
God.prototype.animateHappy = function(type) {
|
||||
this.loadTexture('god_happy');
|
||||
this.mainGame.speechBubble.showSpeechBubble(type);
|
||||
// this.mainGame.speechBubble.showSpeechBubble(type);
|
||||
|
||||
var tween = game.add.tween(this.scale);
|
||||
tween.to({x:0.7, y:0.7}, 500, Phaser.Easing.Quadratic.Out, true, 0);
|
||||
tween.to({x:0.6, y:0.6}, 500, Phaser.Easing.Quadratic.Out, true, 0);
|
||||
// tween.to({x:0.7, y:0.7}, 1000, Phaser.Easing.Elastic.InOut, true, 0, 2, true);
|
||||
// tween.to({x:0.7, y:0.7}, 1000, Phaser.Easing.Linear.None, true, 0);
|
||||
tween.onComplete.add(this.smileAgain, this);
|
||||
@@ -52,10 +55,12 @@ God.prototype.animateHappy = function(type) {
|
||||
|
||||
God.prototype.animateAngry = function(type) {
|
||||
this.loadTexture('god_angry');
|
||||
this.mainGame.speechBubble.showSpeechBubble(type);
|
||||
// this.mainGame.speechBubble.showSpeechBubble(type);
|
||||
|
||||
var tween = game.add.tween(this.scale);
|
||||
tween.to({x:0.7, y:0.7}, 1000, Phaser.Easing.Bounce.Out, true, 0);
|
||||
// tween.to({x:0.7}, 1000, Phaser.Easing.Quadratic.In, true, 0);
|
||||
tween.to({x:0.6}, 1000, Phaser.Easing.Bounce.Out, true, 0);
|
||||
|
||||
// tween.to({x:0.7, y:0.7}, 1000, Phaser.Easing.Elastic.InOut, true, 0, 2, true);
|
||||
// tween.to({x:0.7, y:0.7}, 1000, Phaser.Easing.Linear.None, true, 0);
|
||||
tween.onComplete.add(this.smileAgain, this);
|
||||
@@ -65,4 +70,15 @@ God.prototype.animateAngry = function(type) {
|
||||
God.prototype.smileAgain = function() {
|
||||
this.scale.set(0.5);
|
||||
this.loadTexture('god_smile');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
God.loadResources = function() {
|
||||
game.load.image('god_angry', '../../../resources/image/character/god/god_hungry.png');
|
||||
game.load.image('god_smile', '../../../resources/image/character/god/god_smile.png');
|
||||
game.load.image('god_happy', '../../../resources/image/character/god/god_happy.png');
|
||||
|
||||
}
|
||||
|
||||
God.POSITION_X = 840;
|
||||
God.POSITION_Y = 640;
|
||||
Reference in New Issue
Block a user