Initial commit

This commit is contained in:
IllusionMan1212
2018-09-30 06:17:31 +02:00
commit 96ce7c0dce
75 changed files with 10420 additions and 0 deletions
+45
View File
@@ -0,0 +1,45 @@
ig.module(
'game.entities.cheese'
)
.requires(
'impact.entity',
'game.entities.kuroneko',
)
.defines(function() {
EntityCheese = ig.Entity.extend({
collides: ig.Entity.COLLIDES.LITE,
size: {x: 32, y: 20},
offset: {x: 0, y: 12},
gravityFactor: 0,
animSheet: new ig.AnimationSheet('media/cheese.png', 32, 32),
init: function(x, y, settings) {
this.parent(x, y, settings);
this.addAnim('normal', 1, [0]);
},
update: function() {
this.parent();
this.currentAnim = this.anims.normal;
},
collideWith: function(other, axis) {
this.player = ig.game.getEntitiesByType(EntityKuroneko)[0];
if (other instanceof EntityKuroneko) {
this.kill();
if (this.player.health < 4) {
this.player.health += 1;
}
}
},
kill: function() {
ig.game.removeEntity(this);
}
})
})