Advertisement

RenderWorld()

Started by October 10, 2000 10:38 PM
4 comments, last by Scooter 24 years, 3 months ago
Hi, I was wondering how everyone makes their title screens for their games. Do you have two render statments in side the main loop like RenderTitle() and RenderWorld()? and do the frame moves apart from one another? or just one big RenderWorld() where you do all the frame move and just exclude all the game stuff when rendering the title screen and vice versa. ?
We are here just like this,It really doesn't matter why.The world is here like it is,'We could laugh we could cry.Is it good or is it bad,Wright or maybe wrong?There's no use of being sad,Without a purpose within a song.
There isn''t a common way to draw a title screen, man! The heavily depends on the game and it''s structure...
Advertisement
I''ve always wondered about game structure myself personally... since I haven''t been doing games for too long. I''m guessing the way the pros do it is to have different code for different things... your entire game can''t be in a single

while (!quit)
{
getinput();
dostuff();
drawscreen();
}

unless it was a really simplistic game, or else you would have hundreds or flags being checked and going off and generally making you miserable and slowing things down. I think what they do is have specific code for the titlescreen, the options menu, the first level, the second, the third, the bonus level, the hidden level, etc. and they just load that off a dll. So that means they rewrite their game loop for each instance, but not all of it, the getinput() part would probably be called, so would anything else that is done repeatedly but isn''t specific to what the player is doing or where they''re at in the game.

------------
- outRider -
Hey outRider,

Why you will need more than that ?


while (!quit)
{
ProcessInput ();
ProcessAI ();
AnimateWorld ();
RenderWorld ();
}

As a GAME LOOP, i think that seem perfect ...

But, as you said you dont fit all of your game inside that ...


This is a very small part of a game, called the GAME LOOP ...

But, from the start a game will look more something like ...

VideoInit ();
SoundInit ();
PlayAVI (IntroAvi);
ShowTitle ();
WaitKey () || Wait15Sec ();

ShowMenu ();

if (SelectedMenu == Options) ShowOptions ();
// Load Level, then Goto GameLoop !!
if (SelectedMenu == NewGame) StartNewGame ();

But, as the Anon said, it's always depends of the game's design.

Happy Coding,

LowRad


Edited by - LowRad on October 11, 2000 11:30:37 AM
I understand what all i have to do as far as get input, move things, collision detection..ect, but what i''m wondering is do the pros put their intro within the main game loop or just before it but after all the initilization stuff? (understand?)
We are here just like this,It really doesn't matter why.The world is here like it is,'We could laugh we could cry.Is it good or is it bad,Wright or maybe wrong?There's no use of being sad,Without a purpose within a song.
You would typically use an FSM. The way I implement mine is:
void (*loop)();void titlescreen();void gameloop();loop = titlescreen; 

and in titlescreen I would check if the user wanted to move onto the game and then set loop to gameloop. If you have a lot of states this is better than a giant switch statement or a huge if-else if ladder. Function pointers are useful for all sorts of things you see, which is why any language without them is at a disadvantage.

------------------------------
#pragma twice


sharewaregames.20m.com

This topic is closed to new replies.

Advertisement