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 lwnexgen

Hi All -

I'm trying to figure out a conceptual question with how to design my game.

I need to generate an array that will hold some information about the current map.

This array does not need to have a draw, update, or init method, because Impact will not need to directly render it.

As a convenience, I've come up with a constructor that builds this array for me.

Where would I put this method so that my GenerateGame object could call:
var mapData = new ExtendedArrayLikeObject()

Does it go in a module of its own? (ie, #game.ExtendedArrayLikeObject)? If so, what would I need that module to define in order for entities to be able to create them?

1 decade ago by Joncom

Where would I put this method so that my GenerateGame object could call...
You could make a file called extended-array-like-object.js and put it in /lib/game/.

ig.module(
    'game.extended-array-like-object'
)
.requires(
  
)
.defines(function() {
  
    ExtendedArrayLikeObject = {
        // ...
    }

});

And then require this new module in any module where ExtendedArrayLikeObject is called...
Page 1 of 1
« first « previous next › last »