HTML5 point and click adventure game code structure with CreateJS
Posted
by
user1612686
on Game Development
See other posts from Game Development
or by user1612686
Published on 2012-11-19T21:46:14Z
Indexed on
2012/11/19
23:24 UTC
Read the original article
Hit count: 487
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!
© Game Development or respective owner