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 hellagot

Hi,

i am trying to put code i want to use in further games in to a own library, so i created a new directory in the same directory where game and impact resides, lets say mylib

Within mylib i created test.js:

ig.module(
        'mylib.test'
)
.requires(
        'impact.debug.debug'
)
.defines(function(){

var Test = ig.Class.extend({
        draw: function() {
                ig.log( "draw" );
        }
});

});

and in my main.js is add to the 'requires' array a entry named 'mylib.test'

This does work without parse errors, but as soon as i do a

var t = new Test();

I get a 'Test is not defined' error.

How can i achieve something like this.

1 decade ago by hellagot

arrrr, the second i proofread the forum entry i saw the error:

'var Test =' should be 'Test ='

problem solved... again..

1 decade ago by stahlmanDesign

I also thought of making a library that is used by different games instead of just copying everything in each game. Let us know if you run into any problems.
Page 1 of 1
« first « previous next › last »