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.

Newcomers DBPro Corner / A stupid little game but i have a problem...

Author
Message
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 11th Jun 2005 08:31
Hey all,
I was just making a stupid little game, but i cant get something to work. When you type the word correctly it should move you. But sometimes it does and sometimes it doesnt, its like it decides randomly, do you know why? Heres the code:



Video games…they take you places unreachable, unfeasible. Putting you in the book...putting you in the movie...putting you in a world, that before could only be imagined. expage.com/piratesmainpage.
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 11th Jun 2005 09:33 Edited at: 11th Jun 2005 09:42
Its all about the order in which the code runs. Try something like this:



[edit] Somehow this got cut short Here is the missing part.

In your code it was running in this order after you press enter:



So you were getting input before the match was actually printed to the screen and it was just luck because you only had 2 choices that it moved when it did.


My code runs like:



Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 11th Jun 2005 12:40
ahh...ok, thanks .

Video games…they take you places unreachable, unfeasible. Putting you in the book...putting you in the movie...putting you in a world, that before could only be imagined. expage.com/piratesmainpage.
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 11th Jun 2005 13:05
ok, this input stopping the loop thing is really getting on my nerves . I want the AI to be constantly moving, not just when you press enter. How can i do this?

Video games…they take you places unreachable, unfeasible. Putting you in the book...putting you in the movie...putting you in a world, that before could only be imagined. expage.com/piratesmainpage.
NanoBrain
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 11th Jun 2005 14:37 Edited at: 11th Jun 2005 14:42
Gil Galvanti,

You won't be able to implement the constant flow of the program with the input command. Instead, if you have DarkBasic Classic Enhanced version, you can use the entry$() and clear entry buffer commands, with a few of your own functions, to allow the program to be enabled to except input from the user, while the program continues its flow. The entry buffer wil allow you to collect what the user has typed without the mess of frame-rate getting in the way.




+NanoBrain+
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 11th Jun 2005 17:31
Also look in code base under Entry$. there a few, some you may be able to get to what you wish.

I'm not getting you down am I, Ho Look! another fancy Door?

Login to post a reply

Server time is: 2024-09-23 21:24:04
Your offset time is: 2024-09-23 21:24:04