Splitting game into multiple standalone parts

I'm digging into Starling's CitrusEngine game engine. I try to understand the idea of structuring the game.

If you take a look at chrome.angrybirds.com or puddingmonsters.com you see that games load states (StarlingState's assets) dynamically which is smart. When the game starts a splash-screen displays, then you get a pre-loader which loads the main state (home, settings and choose-level view) and when you select a level a pre-loader displays again which loads the level state. This looks like they've constructed multiple parts for the game and then connect them together where the pre-loader is displayed when switching from one part to other.

How should we do that in Starling/CitrusEngine? What's the logic here? Flash games usually load all assets at the beginning which is not smart on mobile devices. Is it wise to have multiple StarlingCitrusEngine classes or you should handle the whole game in a single StarlingCitrusEngine class? Please explain in details.

Many thanks for answers.

Answers


Flash games usually load all assets at the beginning which is not smart on mobile devices

I agree with you. Better idea would be dynamically load assets as you need them. If it's possible try making single sprite shit for each view. It could be menu, game, and game levels and more...

How ever if you can make your game on one sprite shit, than it will probably be better, as you will not need any loading at all.

Also think about having multiple assets for different resolutions. It can save you a lot of memory on small devices.

Another boost is implementing the preloader on its own worker. I never done this before but it sounds like a good idea. I think you will need new starling context there. It will result in faster performance, but is't not relative to your memory problems.

P.S Did you saw Gazman SDK already?


Need Your Help

Put values in the label in ruby on rails

ruby-on-rails ruby erb

I have a label below and I want to show the value in the label like below: