Skip to content

Commit

Permalink
wolf component created
Browse files Browse the repository at this point in the history
  • Loading branch information
hugeen committed Oct 20, 2012
1 parent 247864c commit 31fa171
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions game/components.js
@@ -1,3 +1,4 @@
define(function(require) {
require('game/components/playable_character');
require('game/components/wolf');
});
26 changes: 26 additions & 0 deletions game/components/wolf.js
@@ -0,0 +1,26 @@
define([
'Underscore',
'Crafty'
], function(_, Crafty) {

Crafty.c("Wolf", {
init : function() {

this.addComponent("2D, Canvas, SpriteAnimation, wolf");

this.attr({
x : 0,
y : 90,
w : 135,
h : 135,
z : 17
});

this.animate("walkWolf", 0, 0, 1);
this.animate("throwAxe", 1, 0, 3);
this.animate("blow", 4, 0, 7);

}
});

});
1 change: 1 addition & 0 deletions game/scenes/level.js
Expand Up @@ -8,6 +8,7 @@ define(function(require) {
init: function(options) {
console.log("Level loaded", options);
player.create();
Crafty.e("Wolf");
}
};

Expand Down

0 comments on commit 31fa171

Please sign in to comment.