diff --git a/src/game/mouse/grilled_meat/game.js b/src/game/mouse/grilled_meat/game.js index 681c37a..65aaeff 100644 --- a/src/game/mouse/grilled_meat/game.js +++ b/src/game/mouse/grilled_meat/game.js @@ -64,6 +64,10 @@ var Game = { this.plusScoreGroup = game.add.group(); var table = game.add.tileSprite(0, 340, GAME_SCREEN_SIZE.x, 660, 'wooden_table'); + + this.god = new God(this); + this.waiter = new Waiter(); + this.meatPlate = game.add.image(220, Game.MEAT_PLATE_POSITION_Y, 'plate'); this.meatPlate.anchor.set(0.5); this.meatPlate.smoothed = false; @@ -76,8 +80,6 @@ var Game = { this.trashCan = new TrashCan(); - this.god = new God(this); - // meat this.bonusMeat = new BonusMeat(this); this.bonusMeat.setActive(false, -100, -100, ""); @@ -195,6 +197,7 @@ var Game = { console.log("badMeatCount : " + this.badMeatCount); this.activatedMeatCount = this.getStageMeatCount(); this.serveMeats(); + this.waiter.animateServing(); }, setClickEnable: function(value) { diff --git a/src/game/mouse/grilled_meat/waiter.js b/src/game/mouse/grilled_meat/waiter.js index 5c45fca..c4be908 100644 --- a/src/game/mouse/grilled_meat/waiter.js +++ b/src/game/mouse/grilled_meat/waiter.js @@ -7,28 +7,28 @@ function Waiter() { Phaser.Sprite.call(this, game, Waiter.POSITION_X, Waiter.POSITION_Y, 'waiter'); this.anchor.setTo(0.5, 1); this.scale.set(0.5); - + this.x = Waiter.POSITION_X; this.inputEnabled = false; - // this.input.enableDrag(false); - // this.events.onInputDown.add(this.onDown, this); - game.add.existing(this); this.speechBubble = new SpeechBubble(); + this.speechBubble.x = 400; + this.speechBubble.y = 150; this.speechBubble.setupWaiterSpeechBubble(); - this.speechBubble.hideSpeechBubble(); + this.speechBubble.hide(); } Waiter.prototype.animateServing = function() { this.speechBubble.show(); + this.x = Waiter.POSITION_X; this.show(); - var tween = game.add.tween(this.x); - tween.to(200, 500, Phaser.Easing.Quadratic.Out, true, 0); + var tween = game.add.tween(this); + tween.to({x:200}, 500, Phaser.Easing.Linear.In, 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.onComplete.add(this.smileAgain, this); tween.start(); @@ -38,16 +38,16 @@ Waiter.prototype.animateServing = function() { Waiter.prototype.hide = function() { this.alpha = 0; - this.x = -100; + this.speechBubble.hide(); } Waiter.prototype.show = function() { - this.x = -100; this.alpha = 1; + this.speechBubble.show(); } -Waiter.POSITION_X = GAME_SCREEN_SIZE.x - 120; +Waiter.POSITION_X = -150; Waiter.POSITION_Y = 340; \ No newline at end of file