1 decade ago by ForceiMck
Here is my code:
ig.module(
'game.entities.player'
)
.requires(
'impact.entity'
)
.defines(function() {
EntityPlayerSet = ig.Entity.extend({
size: {x:16, y:16},
collides: ig.Entity.COLLIDES.ACTIVE,
animSheet: new ig.AnimationSheet('media/ply.png'),
init: function(x,y,settings) {
this.addAnim('idle',1,[0]);
},
update: function() {
if(ig.input.state('up')) {
this.vel.y = 100;
}
if(ig.input.state('down')) {
this.vel.y = -100;
}
if(ig.input.state('left')) {
this.vel.x = -100;
}
if(ig.input.state('right')) {
this.vel.x = 100;
}
this.parent();
}
});
});
Here is the error im getting:
SCRIPT5007: Unable to get value of the property 'length': object is null or undefined
game.js, line 49 character 19
ig.module(
'game.entities.player'
)
.requires(
'impact.entity'
)
.defines(function() {
EntityPlayerSet = ig.Entity.extend({
size: {x:16, y:16},
collides: ig.Entity.COLLIDES.ACTIVE,
animSheet: new ig.AnimationSheet('media/ply.png'),
init: function(x,y,settings) {
this.addAnim('idle',1,[0]);
},
update: function() {
if(ig.input.state('up')) {
this.vel.y = 100;
}
if(ig.input.state('down')) {
this.vel.y = -100;
}
if(ig.input.state('left')) {
this.vel.x = -100;
}
if(ig.input.state('right')) {
this.vel.x = 100;
}
this.parent();
}
});
});
Here is the error im getting:
SCRIPT5007: Unable to get value of the property 'length': object is null or undefined
game.js, line 49 character 19