Add: Trash can

This commit is contained in:
2019-12-06 11:33:30 +09:00
parent 2e14ebc10d
commit 86b7ca3f06
9 changed files with 38 additions and 10 deletions
+7 -6
View File
@@ -62,18 +62,20 @@ var Game = {
this.meatPlate.anchor.set(0.5);
this.meatPlate.smoothed = false;
// this.heatPlate = game.add.image(game.world.centerX, Game.HEAT_PLATE_POSITION_Y, 'heat_plate');
// this.heatPlate = game.add.image(game.world.centerX, HeatPlate.POSITION_Y, 'heat_plate');
// this.heatPlate.anchor.set(0.5);
// this.heatPlate.smoothed = false;
// this.heatPlate.scale.set(1);
this.heatPlate = new HeatPlate(game.world.centerX, Game.HEAT_PLATE_POSITION_Y);
this.stoveDial = new StoveDial(80, Game.HEAT_PLATE_POSITION_Y + 50);
this.heatPlate = new HeatPlate();
this.stoveDial = new StoveDial(80, Game.HEAT_PLATE_POSITION_Y + 70);
this.stoveDial.setOnChangeDialLevelHandler(
(function(dialLevel) { this.onChangeDialLevel(dialLevel); }).bind(this)
);
this.god = new God(game.world.width - 120, Game.GOD_POSITION_Y + 100, this);
this.trashCan = new TrashCan();
this.god = new God(God.POSITION_X, God.POSITION_Y, this);
// meat
this.meatGroup = game.add.group();
@@ -354,5 +356,4 @@ Game.GOD_OUT_OF_FACE_WIDTH = 30;
Game.GOD_OUT_OF_FACE_HEIGHT = 30;
Game.MEAT_PLATE_POSITION_Y = 360;
Game.GOD_POSITION_Y = 240;
Game.HEAT_PLATE_POSITION_Y = GAME_SCREEN_SIZE.y / 2 + 220;
Game.HEAT_PLATE_POSITION_Y = GAME_SCREEN_SIZE.y / 2 + 200;
+8 -1
View File
@@ -15,6 +15,11 @@ function God(x, y, mainGame) {
game.add.existing(this);
this.makeParticles(x, y);
}
God.prototype.makeParticles = function(x, y) {
game.physics.startSystem(Phaser.Physics.ARCADE);
this.fullHeartEmitter = game.add.emitter(x, y - 150, 20);
@@ -51,7 +56,6 @@ function God(x, y, mainGame) {
);
}
God.prototype.update = function() {
}
@@ -132,6 +136,9 @@ God.prototype.particleBurst = function(reaction) {
}
God.POSITION_X = GAME_SCREEN_SIZE.x - 120;
God.POSITION_Y = 340;
God.REACTION_HAPPY = 0;
God.REACTION_SMILE = 1;
God.REACTION_ANGRY = 2;
+4 -2
View File
@@ -1,8 +1,8 @@
HeatPlate.prototype = Object.create(Phaser.Sprite.prototype);
HeatPlate.prototype.constructor = HeatPlate;
function HeatPlate(x, y) {
Phaser.Sprite.call(this, game, x, y, 'heat_plate');
function HeatPlate() {
Phaser.Sprite.call(this, game, HeatPlate.POSITION_X, HeatPlate.POSITION_Y, 'heat_plate');
this.anchor.set(0.5);
// this.scale.set(0.5);
this.smoothed = false;
@@ -46,6 +46,8 @@ HeatPlate.prototype.onChangeDialLevel = function(dialLevel) {
}
HeatPlate.POSITION_X = GAME_SCREEN_SIZE.x / 2;
HeatPlate.POSITION_Y = GAME_SCREEN_SIZE.y / 2 + 200;
HeatPlate.BURN_LEVEL_WEAK = 0;
HeatPlate.BURN_LEVEL_NORMAL = 1;
+2
View File
@@ -39,6 +39,8 @@ var Loading = {
game.load.image('heat_plate_flame', '../../../resources/image/object/grilled_meat/heat_plate_flame.png');
game.load.image('heat_plate', '../../../resources/image/object/grilled_meat/heat_plate.png');
game.load.image('trash_can', '../../../resources/image/object/grilled_meat/trash_can.png');
game.load.image('meat1', '../../../resources/image/object/grilled_meat/meat1.png');
game.load.image('meat2', '../../../resources/image/object/grilled_meat/meat2.png');
game.load.image('meat3', '../../../resources/image/object/grilled_meat/meat3.png');
+1 -1
View File
@@ -4,7 +4,7 @@ StoveDial.prototype.constructor = StoveDial;
function StoveDial(x, y) {
Phaser.Sprite.call(this, game, x, y, 'stove_dial');
this.anchor.set(0.5);
// this.scale.set(0.5);
this.scale.set(1.3);
this.smoothed = false;
this.inputEnabled = true;
game.add.existing(this);
+15
View File
@@ -0,0 +1,15 @@
TrashCan.prototype = Object.create(Phaser.Sprite.prototype);
TrashCan.prototype.constructor = TrashCan;
function TrashCan() {
Phaser.Sprite.call(this, game, TrashCan.POSITION_X, TrashCan.POSITION_Y, 'trash_can');
this.anchor.set(0.5);
// this.scale.set(1);
this.smoothed = false;
this.inputEnabled = false;
game.add.existing(this);
}
TrashCan.POSITION_X = God.POSITION_X - 200;
TrashCan.POSITION_Y = God.POSITION_Y - 30;
+1
View File
@@ -71,6 +71,7 @@
<script src="../../game/mouse/grilled_meat/speech_bubble.js"></script>
<script src="../../game/mouse/grilled_meat/heat_plate.js"></script>
<script src="../../game/mouse/grilled_meat/stove_dial.js"></script>
<script src="../../game/mouse/grilled_meat/trash_can.js"></script>
<script src="../../game/mouse/grilled_meat/game.js?update=190916"></script>
<script src="../../game/mouse/grilled_meat/main.js"></script>