Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / return to menu screen problem

Author
Message
Mychal B
14
Years of Service
User Offline
Joined: 21st Jul 2010
Location: Coos bay, rainville
Posted: 6th Sep 2010 12:33
Yet another question! I think this one should be quick, but I couldn't find a solution on the forums.

So I got my title screen working and when you press enter you go to the game. When you kill all of the enemys you are supposed to return to the title screen.

Problem: When I kill all the enemies the display shows the last part of the game instead of the menu, but I know its working because when I press enter it restarts the game!

LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 6th Sep 2010 14:18
You would need to set up everything in subroutines or functions in such a way that you can access the routines when needed. Typically, I will have some structure along these lines:

Process the Title/Menu screen subroutine / function and move to the Main do-loop.

The Main do-loop includes a check to see if the game is over. If so, it will process a Game Over subroutine / function. After that it will again process the Title/Menu screen subroutine / function (calling it from within the main do-loop). If the user wants to play again, a Restart subroutine / function is processed (once again, it is called from within the Main do-loop). The Restart code will re-init all variables, sprites, objects, arrays, etc. The game does not exit the Main do-loop until the user selects Quit in the Title/Menu code.

Hope this is helpful.

So many games to code.......so little time.
Mychal B
14
Years of Service
User Offline
Joined: 21st Jul 2010
Location: Coos bay, rainville
Posted: 6th Sep 2010 20:17
LOL, probably a total newb move. I figured all of the stuff that you mentioned, but the problem was that I didn't know I had to use sync when I pasted my menu image again Thanks for the help though! I probably shoulda tried just a lil harder before asking, sorry and thanks!

Login to post a reply

Server time is: 2024-09-28 22:30:45
Your offset time is: 2024-09-28 22:30:45