Add: Trash can
This commit is contained in:
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
Reference in New Issue
Block a user