Add: grilled meat basic sources

This commit is contained in:
2018-10-31 11:12:42 +09:00
parent 2e1ae58e7f
commit 5464642d9b
28 changed files with 965 additions and 3 deletions
+67
View File
@@ -0,0 +1,67 @@
God = function(game, x, y) {
this.isActivated = true;
Phaser.Sprite.call(this, game, x, y, 'god_angry');
this.anchor.setTo(0.5, 1);
this.scale.set(0.5);
this.inputEnabled = false;
// this.input.enableDrag(false);
// this.events.onInputDown.add(this.onDown, this);
game.add.existing(this);
}
God.prototype = Object.create(Phaser.Sprite.prototype);
God.prototype.constructor = God;
God.prototype.update = function() {
}
God.prototype.onDown = function(sprite, pointer) {
console.log("onDown : " + pointer.x + ", " + pointer.y);
this.animateAngry();
}
God.prototype.isInRect = function(x, y) {
return true;
}
God.prototype.onDragStop = function(sprite, pointer) {
console.log("onDragStop : " + pointer.x + ", " + pointer.y);
}
God.prototype.setScale = function(size) {
this.scale.set(size);
this.backupScale = size;
}
God.prototype.animateHappy = function(type) {
this.loadTexture('god_happy');
showSpeechBubble(type);
var tween = game.add.tween(god.scale);
tween.to({x:0.7, y:0.7}, 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);
tween.start();
}
God.prototype.animateAngry = function(type) {
this.loadTexture('god_angry');
showSpeechBubble(type);
var tween = game.add.tween(god.scale);
tween.to({x:0.7, y:0.7}, 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);
tween.start();
}
God.prototype.smileAgain = function() {
this.scale.set(0.5);
this.loadTexture('god_smile');
}