Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

wagon added

  • Loading branch information...
commit 33aead61c6fa2f3ebfe686af1d3afec4846105fe 1 parent 80f6758
@hugeen authored
View
1  game/components.js
@@ -1,5 +1,6 @@
define([
'game/components/battlefield/wires',
+ 'game/components/battlefield/wagon',
'game/components/box2d',
'game/components/bullet',
'game/components/characters/character',
View
7 game/components/characters/wolf.js
@@ -9,7 +9,7 @@ define([
this.addComponent("SpriteAnimation, wolf, Collision");
this.attr({
- x : 0,
+ x : -19,
y : 90,
w : 135,
h : 135,
@@ -21,6 +21,11 @@ define([
this.animate("walkWolf", 0, 0, 1);
this.animate("throwAxe", 1, 0, 3);
this.animate("blow", 4, 0, 7);
+
+ var wagon = Crafty.e("Wagon");
+ wagon.attr({ x: this._x+15, y: this._y+50 })
+
+ this.attach(wagon);
}
});
View
4 game/components/player_move.js
@@ -32,10 +32,10 @@ define([
this.bind("EnterFrame", function() {
- if(this.movement.north) {
+ if(this.movement.north && this._y >= 30) {
this.move("n", 10);
}
- if(this.movement.south) {
+ if(this.movement.south && this._y <= 370) {
this.move("s", 10);
}
});
View
4 game/skills.js
@@ -18,8 +18,8 @@ define([
action: function() {
var player = PlayerEntity.get();
Crafty.e("Attack").attack({
- x: player.x,
- y: player.y
+ x: player.x+40,
+ y: player.y+25
}, mousePosition());
},
backgroundPosition: "-53px 0"
Please sign in to comment.
Something went wrong with that request. Please try again.