Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by Rubix

Hello, I'm trying to create enemy objects that extend a parent class contained in the same module. However I'm getting a reference error when I run the game; here's my code:

EntityWorm = EnemyClass.extend({

I assumed you could simply reference a class in the same entity, but am I wrong in thinking this?

1 decade ago by maluslupus

will need a little more than that....

I did something similar for a particle gen, ie have a base class for all particles and extend them in the same module for different types eg bluesparks, randomsparks etc

ig.module(
        'game.entities.particle'
    ).requires(
        'impact.entity'
    ).defines(function(){

EntityParticle = ig.Entity.extend({ some code stufff});

 BlueSparks = EntityParticle.extend({ some other code that changes values for EntityParticle});

});

1 decade ago by maluslupus

obviously change you requires and module. I'm an ImpactJS noob too so if this is wrong then my apologies...
Page 1 of 1
« first « previous next › last »