![]() |
|
#1
|
|||
|
|||
Typing tutor Game problemI am working on the code of a C++ game program in which....words keep falling from top to bottom of the screen...the user has to enter the word before the word reaches the end of the screen..
I figured out how to make the words fall Any help would be appreciated...i m using turbo C++ 4.5...just tell me atleast which inbuilt function i can use.. Thanx |
|
#2
|
||||
|
||||
Re: Typing tutor Game problemLook into the functions kbhit() and getch(). These functions will help you out.
__________________
Got a cough? Go home tonight and eat a whole box of Ex-Lax. Tomorrow, you'll be afraid to cough. -- Pearl Williams |
|
#3
|
|||
|
|||
Re: Typing tutor Game problemI tried kbhit() and getch(), it didnt work...the word stops falling so that the user can enter sumthing...i want sumthing so that the word keeps falling and the user can enter whatever he wants.... ;-)
|
|
#4
|
||||
|
||||
Re: Typing tutor Game problemQuote:
__________________
Got a cough? Go home tonight and eat a whole box of Ex-Lax. Tomorrow, you'll be afraid to cough. -- Pearl Williams |
|
#5
|
|||
|
|||
Re: Typing tutor Game problemCool...could u plllleeeeeaaaasse give me an extract of the code so that i can understand better...thanx a ton dude... :-)
|
|
#6
|
||||
|
||||
Re: Typing tutor Game problemQuote:
Just post the area of the program you're having trouble with, but enough to see the the program flow. __________________
Got a cough? Go home tonight and eat a whole box of Ex-Lax. Tomorrow, you'll be afraid to cough. -- Pearl Williams |
|
#7
|
|||
|
|||
Re: Typing tutor Game problemHere is the code....
CPP / C++ / C Code:
Now up here i made the word fall but how do i make the user enter sumthing while its falling... Any help would be appreciated... Thanx |
|
#8
|
||||
|
||||
Re: Typing tutor Game problemQuote:
#1: void main() -- not good, here's why #2: I don't see where you tried using kbhit() at all. That must be used to figure out if there is a key that's been pressed. If so, read the character. If not, just drop the word. It therefore would go in your inner loop. Try writing a program using kbhit() and getch() in conjunction with many putchar() statements to see what happens at each step. This is the way you use them together: CPP / C++ / C Code:
#3: Your formatting needs work. See this. It's important because when your programs get larger, you will get lost trying to follow the code. __________________
Got a cough? Go home tonight and eat a whole box of Ex-Lax. Tomorrow, you'll be afraid to cough. -- Pearl Williams |
|
#9
|
|||
|
|||
Re: Typing tutor Game problemQuote:
I don't have your version of Turbo C, but I played around with bcc32 (the free download command-line compiler from Borland) on my Windows XP machine. The following gave something worth testing: CPP / C++ / C Code:
Now, if your compiler doesn't like these headers, you can use what you had before, but this is the preferred Standard way of doing things with C++. Note that <conio.h> is not a standard library header, and kbhit() and clrscr() and gotoxy() are not standard library functions, but they work for my version of Borland C (and C++) compiler. Good enough for a personal game and for learning in general, but not portable. Regards, Dave |
|
#10
|
|||
|
|||
Re: Typing tutor Game problemThanx for the tips guys...Our professor at skool uses "void main()". Picked it up frm him. Steve Summit must be right...makes sense too. Also, the formatting page is helpful..nice!
|
Recent GIDBlog
Developing GUIs with wxPython (Part 4) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Graphic problem in Unreal Tournament 2004 | zerox | Computer Software Forum - Games | 10 | 09-Oct-2005 13:31 |
| Runtime Problem involving "printf" in C Program | supamakia | C Programming Language | 2 | 09-Oct-2005 11:09 |
| a significant problem after installing Xp | mohammad | Computer Software Forum - Windows | 10 | 09-Aug-2005 08:03 |
| Another FX 5600 problem (but with details that might shed light on this) | BobDaDuck | Computer Hardware Forum | 2 | 16-Apr-2004 08:53 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The