Code design structure

BlitzMax Forums/BlitzMax Beginners Area/Code design structure

My game framework has all that and more. Click the link in my sig, run the demo, it might give you some ideas... I like to get all this in place BEFORE writing the game so the game is just good fun then as all the "boring" stuff is done.

Anyway, your mainloop shouldn't really be based around the escape key (mostly that's just demos, code samples or mini-games). It should be something like While Loop=True Wend. Then in the while loop you can set Loop to False when the user clicks exit or presses escape or whatever. Pausing is easy, when P is pressed set a variable called Paused to True and make sure your logic code is contained in an If not Paused then ... End If structure. Menus take a bit more work...