1 decade ago by ooker
I am working on an MMO with ImpactJS.
I have some javascript files that I include on the server with require
e.g.
mmoTypes.js:
mmoTypes = {
Messages: {
JOIN: 0,
SPAWN: 1,
MOVE: 2
}
};
I'd like to be able to use this file as-is on the client, but it seems that to use the Impact class loader, I need to create a module, etc. and as a result I need two different files...One on the server without the module business and one on the client with all the ig module stuff.
I'd like to have just one file, so as I make changes, I make them in just one file.
Does anyone have a recommended way to do this?
I have some javascript files that I include on the server with require
e.g.
mmoTypes.js:
mmoTypes = {
Messages: {
JOIN: 0,
SPAWN: 1,
MOVE: 2
}
};
I'd like to be able to use this file as-is on the client, but it seems that to use the Impact class loader, I need to create a module, etc. and as a result I need two different files...One on the server without the module business and one on the client with all the ig module stuff.
I'd like to have just one file, so as I make changes, I make them in just one file.
Does anyone have a recommended way to do this?