Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Bezzant

Title Screen

This topic is 6489 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, Im making a game, nothing special because Its the first game I started making but will be my 4 game made. Well I want to make a title screen before gameplay begins. I have an idea: My game screen is like this: ... DrawGLGame(); ... ... // draw everything ... DrawGLTitle(); ... ... // draw title ... Well when you load the DrawGLGame in the WinMain part I load DrawGLTitle(); instead. Well I want so if they press say ''B'' it loads DrawGLGame(); So my key control looks like this: if(keys[66]) { DrawGLGame(); } This works fine but you need to hold in the ''B'' key for it to display the game screen. I understand why, BUT cant figure out a way so you don''t have to hold ''B'' What a few of you kindly help, Many Thanks Alan IF YA SMELL... WHAT THE BEZZ IS COOKIN''''

Share this post


Link to post
Share on other sites
Advertisement
One method would be to set a flag

bool gamerunning = false;

Then in your loop

if(keys[66])
gamerunning = true;

if (gamerunning)
DrawGLGame();
else
DrawGLTitle();


You could also have an int holding the game state and call the appropriate function from the value of int.

Share this post


Link to post
Share on other sites

Many Thanks TwoFlower. It works like a charm, I can now continue with the rest of the game.

One more question, about displaying text, I have done it before I build the font, print, and kill it but when I try to display it I set the rasterpos and give it a color have it all set as I have with other demo''s/games but with this one It won''t display the text. Any ideas on the possile cause of this problem?

Many Thanks For The Help

Alan

IF YA SMELL... WHAT THE BEZZ IS COOKIN''''

Share this post


Link to post
Share on other sites
at first ensure that you enable GL_TEXTURE_2D before printing the text, because otherwise it won''t work!



Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!