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.

Dark GDK / using dbInput()

Author
Message
Wikaman1
16
Years of Service
User Offline
Joined: 17th Aug 2008
Location: Scotland
Posted: 21st Feb 2009 20:50
I trying to use dbInput() the give the user a choice on what level to play at the start of my game. So far I have this but whatever I type in I get "incorrect input". Anybody know why?

dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 21st Feb 2009 21:05
Quote: "if (level_choice=="one")"


You are comparing pointers here, in this instance they will never be equal. Instead use strcmp() where a return value of 0 means they match.

I should make a template of this post as I'm sure I've said the same thing 50 times.

heyufool1
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location: My quiet place
Posted: 21st Feb 2009 21:05
try checking if level_choice is the number one rather then the word
Wikaman1
16
Years of Service
User Offline
Joined: 17th Aug 2008
Location: Scotland
Posted: 21st Feb 2009 21:13
Thanks for your help dark coder

Login to post a reply

Server time is: 2024-09-30 19:22:25
Your offset time is: 2024-09-30 19:22:25