Way to choose gamestate?
Just use switch/case...Slow ??? Hell no...I mean..you only do 1 pr. frame...That''s nothing..Come on...Computers are fast these days....
Wow! So many replies, I never thought I would get this feedback in so short time, thank you!
What I''ve made out of this is, since I haven''t done anything with function pointers yet, I''ll try to wait with that. I''m going to try the "enum gamestate" way. So please correct this if I''m wrong:
enum gamestate { Init, Menu, Game, Exit, etc etc }
switch(gamestate)
{
case Init: Init_Funtion();
case Menu: Menu_Function();
}
and something like this:
if(key[VK_ESCAPE])
gamestate = Exit;
Did I get that right(except for the syntax)?
Thank you VERY much again!
/* The only difference between a genius and a madman is the success. */
What I''ve made out of this is, since I haven''t done anything with function pointers yet, I''ll try to wait with that. I''m going to try the "enum gamestate" way. So please correct this if I''m wrong:
enum gamestate { Init, Menu, Game, Exit, etc etc }
switch(gamestate)
{
case Init: Init_Funtion();
case Menu: Menu_Function();
}
and something like this:
if(key[VK_ESCAPE])
gamestate = Exit;
Did I get that right(except for the syntax)?
Thank you VERY much again!
/* The only difference between a genius and a madman is the success. */
I posted it all of that because software engineering is really tough to implement. I thought if i just gave him only a brief overview of what to do that he may still make mistakes that I''ve done in the past, so i just showed a rudimentary 3 module, 3 state game strucutre. Sorry to piss you guys off If anyone wants the original code feel free to email me at kking@digipen.edu .
- Kevin "BaShildy" King
Game Programmer: DigiPen
www.mpogd.com
- Kevin "BaShildy" King
Game Programmer: DigiPen
www.mpogd.com
quote:Original post by BaShildy
I posted it all of that because software engineering is really tough to implement. I thought if i just gave him only a brief overview of what to do that he may still make mistakes that I''ve done in the past, so i just showed a rudimentary 3 module, 3 state game strucutre. Sorry to piss you guys off If anyone wants the original code feel free to email me at kking@digipen.edu .
It''s not that serious. I just feel (very strongly) that it''s sometimes easier to communicate by saying less.
[ GDNet Start Here | GDNet Search Tool | GDNet FAQ | MS RTFM [MSDN] | SGI STL Docs | Google! ]
Thanks to Kylotan for the idea!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement