Does your game use a State system for the main game loop?
Although I don't use DelphiX for my game, I display a splash screen while my game resources are being loaded, before my main game loop is reached.
If you have a state system then you should be able to do this easily.
Code:
While not quitting
Begin
Case GameState of
Intro:
Blit into image to screen canvas.
Do Into specific input checks - Change GameState to MainMenu when key pressed
MainMenu:
Do main menu stuff
Do Menu specific input checks - Change GameState to InGame when new game is pressed, or Quitting when Quit is pressed.
InGame:
Do Game stuff
Do game specific input checks - Change GameState to MainMenu when killed or Esc pressed.
Quitting:
Render Quitting image
set Quitting Flag to True
end
Do Generic input checks
Flip surfaces.
end
Hope this makes sense.
My state machine is similar, but a bit more complicated, it uses LastState, NewState and CurrentState sections. It gives me a lot of flexibility.
Hope this helps..
P.S. you might want to put this sort of post in the DelphiX section in future, although this request appears to be for a generic answer... unless you're after DelphiX code.. but seriously, this is so noddy, it won't take you long to implement.
Bookmarks