HTML5 point and click adventure game code structure with CreateJS
- by user1612686
I'm a programming beginner.
I made a tiny one scene point and click adventure game to try to understand simple game logic and came up with this:
CreateJS features prototypes for creating bitmap images, sprites and sounds objects. I create them and define their properties in a corresponding function (for example images(); spritesheets(), sounds()...). I then create functions for each animation sequence and "game level" functions, which handle user interactions and play the according animations and sounds for a certain event (when the level is complete, the current level function calls the next level function). And I end up with quite the mess.
What would be the "standard (if something like that exists)" OOP approach to structure simple game data and interactions like that?
I thought about making game.images, game.sprites, game.sounds objects, which contain all the game data with its properties using CreateJS constructors. game.spriteAnimations and game.tweenAnimations objects for sprite animations and tweens and a game.levelN object, which communicates with a game.interaction object, processing user interaction. Does this make any sense?
How do you structure your simple game code?
Thanks in advance!