1 decade ago by begeeben
I'm building mini games with localization and multiple themes. We'll have images and sounds for multiple languages, and every theme has to be multi-language supported. In order not to preload unnecessary resources in the game, what I come up with is giving every different theme and language a game instance with only the resources it needs. For example:
The folder structure is like:
/lib/game/tictactoe/christmas/TictactoeChristmasEN.js
/media/tictactoe/christmas/en/
Each game module is designed like:
game.main will be like:
It bothers me that the only different thing is the resources for different themes and languages, the game logic will be all the same. Doing this doesn't seem right to me.
Is there a better way to structure it?
The folder structure is like:
/lib/game/tictactoe/christmas/TictactoeChristmasEN.js
/media/tictactoe/christmas/en/
Each game module is designed like:
ig.module( 'game.tictactoe.christmas.TictactoeChristmasEN' ) .requires( 'impact.game' ) .defines(function(){ TictactoeChristmasEN = ig.Game.extend({ }); });
game.main will be like:
ig.module( 'game.main' ) .requires( 'impact.game', 'impact.font', 'game.tictactoe.christmas.TictactoeChristmasEN', 'game.tictactoe.halloween.TictactoeHalloweenEN', 'game.pong.christmas.PongChristmasEN', ..... keep going ) .defines(function() { });
It bothers me that the only different thing is the resources for different themes and languages, the game logic will be all the same. Doing this doesn't seem right to me.
Is there a better way to structure it?