C# Game menu

Get help on programming - C++, Java, Delphi, etc.
Post Reply
Salomon
Registered User
Posts: 13
Joined: 10 Feb 2010, 20:57
Location: SA

C# Game menu

Post by Salomon »

Who knows how to create a game menu from scratch when the game starts? I want to be able to go back to the menu while i play the game (end the current game)
RuadRauFlessa
Registered User
Posts: 20576
Joined: 19 Sep 2003, 02:00
Location: Bloodbank

Re: C# Game menu

Post by RuadRauFlessa »

Loops ????
:rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock:
Spoiler (show)
Intel Core i7-2600k @ 3.4GHz
Corsair Vengence 2x4GB DDR3 2000MHz
Thermaltake Toughpower 850W
ASUS nVidia GTX560 1GB
CoolerMaster HAF 932
RuadRauFlessa
Registered User
Posts: 20576
Joined: 19 Sep 2003, 02:00
Location: Bloodbank

Re: C# Game menu

Post by RuadRauFlessa »

No Seriously loops are your friend.

in the callback loop you use for key capturing you would check for the key or event which would enable the menu. Then you break from everything else but keeping the current game state intact. Then you simply bug out to a menu loop/thread which handles the display for the menu. Also you might want to split up your main inputs so that your first check is to see if the menu is enabled if it is handle the input only for the menu if not handle it only for the controls in the game. Sounds simple but it will take some thought as to how you really want to go about it. As many games as I have seen just so many ways have I seen this being done. One thing always remains the same though. Just bug out to another loop and stop the one handling the rest of the game. That is unless you want both running at the same time like the one in the Quake engine which simply pops down and still has the rest of the game operating in the background. Then you would simply have to deal for it in the normal input / game loops. Still you have to play around with loops for this.
:rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock: :rock:
Spoiler (show)
Intel Core i7-2600k @ 3.4GHz
Corsair Vengence 2x4GB DDR3 2000MHz
Thermaltake Toughpower 850W
ASUS nVidia GTX560 1GB
CoolerMaster HAF 932
Salomon
Registered User
Posts: 13
Joined: 10 Feb 2010, 20:57
Location: SA

Re: C# Game menu

Post by Salomon »

Thanx for the help!
User avatar
rustypup
Registered User
Posts: 8872
Joined: 13 Dec 2004, 02:00
Location: nullus pixius demonica
Contact:

Re: C# Game menu

Post by rustypup »

separate threads and a layered rendering stack....

the game thread stack needs to be pausable... which means you'll need to have a single clock thread holding a collection of content generation/consumption threads....
Most people would sooner die than think; in fact, they do so - Bertrand Russel
1gn1t0r
Registered User
Posts: 56
Joined: 07 Feb 2006, 02:00
Contact:

Re: C# Game menu

Post by 1gn1t0r »

Create a Screen Manager class for your game. This will control all the different screens your game has e.g Main Menu, pause, Gameplay. There are various techniques to do so.
I recommend creating games with XNA, see the site for more info. I think they have a network sample there which uses this implementation.
http://creators.xna.com
Post Reply