Jump to content



0

Multiple game screens


1 reply to this topic

#1 nmoog OFFLINE  

nmoog

    Space Invader

  • 44 posts

Posted Wed Jul 19, 2006 7:58 PM

I was just wondering about the best way to draw "multiple screens" in your games (such as splash screens or different game screen that can not use the same kernel)

For instance, a game might require the following game states:

1. Splash screen
2. Main game screen with 1/2 second "get ready" pause"
3. Running main game screen
4. Switch screen to game element #2 with 1/2 second "get ready" pause
5. Running game element #2
6. Game over with enemies still moving

As I am adding more pieces to my game, such as end-of-levels etc, my code is getting more spaghetti like - In higher level languages I'd just have a "state" variable and do a switch statement like
switch(GameState){
case STATE_SPLASH: drawSplash();
case STATE_RUNNING: drawLevel(CurrentLevel);
...
}

Kind of thing. How do you organise your game screens and levels nicely for the 2600? At the moment I am drawing a standalone kernel (with vblanks, and overscans) for the Splash screen and then another kernel (with vblanks and overscan) for the "main game". But as I go to add another screen, it's starting to get ugly - especially as I want it to draw one frame of the new screen, pause for 1/2 second, then continue.

Any suggestions on handling these types of game elements?!

#2 SeaGtGruff OFFLINE  

SeaGtGruff

    River Patroller

  • 4,547 posts
  • Location:Georgia, USA

Posted Wed Jul 19, 2006 9:41 PM

View Postnmoog, on Wed Jul 19, 2006 9:58 PM, said:

I was just wondering about the best way to draw "multiple screens" in your games (such as splash screens or different game screen that can not use the same kernel)

For instance, a game might require the following game states:

1. Splash screen
2. Main game screen with 1/2 second "get ready" pause"
3. Running main game screen
4. Switch screen to game element #2 with 1/2 second "get ready" pause
5. Running game element #2
6. Game over with enemies still moving

As I am adding more pieces to my game, such as end-of-levels etc, my code is getting more spaghetti like - In higher level languages I'd just have a "state" variable and do a switch statement like
switch(GameState){
case STATE_SPLASH: drawSplash();
case STATE_RUNNING: drawLevel(CurrentLevel);
...
}

Kind of thing. How do you organise your game screens and levels nicely for the 2600? At the moment I am drawing a standalone kernel (with vblanks, and overscans) for the Splash screen and then another kernel (with vblanks and overscan) for the "main game". But as I go to add another screen, it's starting to get ugly - especially as I want it to draw one frame of the new screen, pause for 1/2 second, then continue.

Any suggestions on handling these types of game elements?!

You could try grouping similar screens together, so you could use one kernel for one group of similar screens, a second kernel for a second group of similar screens, etc.

Or you could try using just one main kernel that does all the things that will be common to all of the screens (like overscan, vsync, and vblank, including things like checking the console switches and game controllers), then branch or jmp or jsr to different kernel sections based on the specific screen or type of screen that's currently active.

Michael Rideout




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users