Blitz3D Newbies: Implementing a Menu System
by Qox - No Enemies Development Team

Menu systems for games can make your game rating in PC Gaming Magazine go from a 10% to a 97%. It's nessessary to have a menu in your game. You don't want your game to load up and instantly start. Players need to be able to save the game, load the game, configure options, and other things. A menu will also add a nice touch to your game and make it look more official. Part of this code is inspired by Jeremy Alessi, who created FPSNet. Implementing a menu system into your game is quite easy, and takes very little time. I assume that your game is organized into many functions (common functions for a game might be UpdateCamera(), UpdateGun(), etc.). Let's say your main loop looked like this:


To implement a menu system, create this function:


That should take care of everything. If you do not have all your code arranged in functions, then you could just slap all your game code under "game." Your main loop will now look like this:


I hope you found this tutorial useful!


For a printable copy of this article, please click HERE.


This site is Copyright© 2000-2004, BlitzCoder. All rights reserved.