Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411572 Posts in 69386 Topics- by 58444 Members - Latest Member: darkcitien

May 04, 2024, 09:52:55 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityTownhallForum IssuesArchived subforums (read only)TutorialsMain Menu in a sdl game?
Pages: [1]
Print
Author Topic: Main Menu in a sdl game?  (Read 8129 times)
IndieEmma
Level 2
**


View Profile
« 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
zacaj
Level 3
***


void main()


View Profile WWW
« 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
IndieEmma
Level 2
**


View Profile
« 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
zacaj
Level 3
***


void main()


View Profile WWW
« 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
*****


I live in this head.


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

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

Creativity births expression.  Curiosity births exploration.
Our work is as soil to these seeds; our art is what grows from them...


Wreath, SoundSelf, Infinite Blank, Cave Story+, <plaid/audio>
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic