Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

877384 Posts in 32863 Topics- by 24299 Members - Latest Member: aarkling

May 19, 2013, 11:36:58 AM
TIGSource ForumsDeveloperTutorialsMain Menu in a sdl game?
Pages: [1]
Print
Author Topic: Main Menu in a sdl game?  (Read 1299 times)
indietom
Level 2
**

Tom


View Profile Email
« on: July 13, 2012, 04:11:48 AM »

Hi!
I'm working on a shmup in C++ and sdl. How would I write a start menu?What would the code look like? Please send me a tutorial if you know one or help me.

Thanks  Smiley
Logged

Code::Blocks
This is my profile, there are many like it but this one is mine.
zacaj
Level 3
***


void main()


View Profile WWW Email
« Reply #1 on: July 13, 2012, 04:14:37 AM »

Is your problem how to put the menu in so it interacts with the rest of the game well or to program the actual choices and stuff?
Logged

My twitter: @zacaj_

Quote from: mcc
Well let's just take a look at this "getting started" page and see--
Quote
Download and install cmake
Noooooooo
indietom
Level 2
**

Tom


View Profile Email
« Reply #2 on: July 13, 2012, 05:00:30 AM »

Is your problem how to put the menu in so it interacts with the rest of the game well or to program the actual choices and stuff?


How do I do so when I press start the games startes?
Logged

Code::Blocks
This is my profile, there are many like it but this one is mine.
zacaj
Level 3
***


void main()


View Profile WWW Email
« Reply #3 on: July 13, 2012, 06:01:32 AM »

How you interface your menu and you game code depends a lot on how your game is structured. Could you give a quick summary or how your game is structured (or post your game loop)?

Also could you describe how you want your menu to be? Maybe a mockup?
Logged

My twitter: @zacaj_

Quote from: mcc
Well let's just take a look at this "getting started" page and see--
Quote
Download and install cmake
Noooooooo
ASnogarD
Level 1
*



View Profile
« Reply #4 on: July 13, 2012, 09:50:36 AM »

Your question (OP) is too vague to answer properly...

Do you have a game, and now want to add gamestates ? Are you programming a game and starting with the gamestates ?

There is a few ways to implement gamestates, a basic method would be to use lots of if statements to check which state your game is in.

while(running){

if(gamestate == IN_MENU) {
do menu stuff
}
if(gamestate == IN_GAME) {
do game stuff
}

}

you could read up on http://www.sdltutorials.com/sdl-app-states for a tutorial, and see if that helps some.
Logged

Somethings are painfully obvious, others must be made obvious... painfully.
Serapth
Level 2
**


View Profile
« Reply #5 on: July 13, 2012, 05:48:08 PM »

I cover a very simple menu in this tutorial.  It's SFML based, but should apply equally to SDL.  Remember, this is *a* way to do it.
Logged
Evan Balster
Level 10
*****


dreaming close to metal


View Profile WWW Email
« Reply #6 on: July 28, 2012, 01:54:34 PM »

For future reference this sort of thing should go in the Technical forum.
Logged

Infinite Blank, SoundSelf, Cave Story+, Wreath
voice, accordion, mandolin, (oboe, soon)
Game audio programming consultant.
<plaid/audio>: opensource audio framework
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic