summaryrefslogtreecommitdiff
path: root/game/prefabs
diff options
context:
space:
mode:
Diffstat (limited to 'game/prefabs')
-rw-r--r--game/prefabs/pill.js5
-rw-r--r--game/prefabs/player.js4
2 files changed, 5 insertions, 4 deletions
diff --git a/game/prefabs/pill.js b/game/prefabs/pill.js
index 2df13f2..50c0277 100644
--- a/game/prefabs/pill.js
+++ b/game/prefabs/pill.js
@@ -4,17 +4,14 @@ var Pill = function(game, x, y, frame) {
Phaser.Sprite.call(this, game, x, y, 'pill', frame);
this.scale = {x: 0.01, y: 0.01};
this.anchor = {x: 0.5, y: 0.5};
- // initialize your prefab here
+ this.game.physics.arcade.enableBody(this);
};
Pill.prototype = Object.create(Phaser.Sprite.prototype);
Pill.prototype.constructor = Pill;
Pill.prototype.update = function() {
-
- // write your prefab's specific update code here
-
};
module.exports = Pill;
diff --git a/game/prefabs/player.js b/game/prefabs/player.js
index 1336003..b520947 100644
--- a/game/prefabs/player.js
+++ b/game/prefabs/player.js
@@ -6,6 +6,10 @@ var Player = function(game, x, y, key, frame) {
this.moving = false;
this.scale = {x: 0.01, y: 0.01};
this.anchor = {x: 0.5, y: 0.5};
+
+ this.game.physics.arcade.enableBody(this);
+
+ this.score = 0;
};
Player.prototype = Object.create(Phaser.Sprite.prototype);