Gaming Your Way

May contain nuts.

The good, the bad, the ugly ...

Hi,
long time no post (but Squize has pretty much made it needless).

What happened so far ...

After a few days off from nearly everything except gaming (on my new shiny plasma) I finally got back to work on Calisto Eclipse. I decided to go the hard way and rewrite most of the menu code (before I even started coding on the game) and ended up with something I might just call the "ScreenFramework".

Basically I usually use the same style for coding:
1st there's a Singleton main controler class through which I can access all the low level stuff, because I hate having to post around references or "crosslink" classes.
This class also provides access to the ScreenFramework (name might change to something catchy), the SF class allows an easy way of switching screens using a predifined "transition".

So to get from "mcScreenMenu" (currently active) to "mcScreenMedal", it's just this (pseudo code):
SF.showScreen("mcScreenMedal", [optional transition code to use]);

... attach the new screen, perform transition, remove the old screen

All screens are "self contained" so before removing them I call the "dispose" method (did I mention that all screens use the SimpleScreen interface?), which cleans the mess the screen has caused in memory and might set a few things in the controler class.

As Calisto is also the testbed for another project we have been tinkering with for a while, it's not just developing the game but also a lot of backend server stuff, which is a pitty, because I really would like to share a good deal more of the development process for CE (although, after having the screen handling nailed I might just show that for the sake of it).

nGFX


Comments (3) -

  • valentino tombesi

    1/9/2009 10:31:35 AM |

    ..or it's tangent to my EasySite class! Check it at my site and i'll be honoured to have you write a reply! :) good work!

  • nGFX

    1/9/2009 10:56:34 AM |

    Thanks guys,

    colby, this looks great. I must admid that my class is based on pure laziness and by far not as complete as yours. It is basically just a wrapper around the the fucking AS3 way of "attachMovie" and "removeMovie", along with some callbacks to ensure that everything is called in the correct order.

    valentino, your class looks nice and usefull, too. Yet again, mine is only half of that, ie. the transitions are coded inside each screen's class and there is no timeline support at all.

    nGFX

Comments are closed