1 decade ago by ape
Maybe I'm just tired, but I thought I'd be able to create an Entity and then extend that Entity.
For example:
This, however, doesn't work. It'll produce a "ig.EntityGhost [undefined] is not an object" error.
Am I missing something?
For example:
/* game/entities/ghost.js */ // a generic 'Ghost' entity ig.module( 'game.entities.ghost' ) .requires( 'impact.entity' ) .defines(function(){ EntityGhost = ig.Entity.extend({ // generic props and methods }); }); /* game/entities/ghost_blue.js */ // a blue 'Ghost' entity ig.module( 'game.entities.ghost_blue' ) .requires( 'game.entities.ghost' ) .defines(function(){ EntityGhostBlue = ig.EntityGhost.extend({ // props and methods specific to blue ghosts }); });
This, however, doesn't work. It'll produce a "ig.EntityGhost [undefined] is not an object" error.
Am I missing something?