| | |
Moving Objects in Turbo C++
Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Dec 2006
Posts: 24
Reputation:
Solved Threads: 0
How do you make an object, say a rectangle, move in turbo c++, using right and left arrow keys?I want the object to move when a user presses right or left arrow keys.
Please reply ASAP either here or at my email <<email address snipped>>
Last edited by ~s.o.s~; Dec 31st, 2006 at 9:56 pm. Reason: Email address snipped according to site policy.
Use the nonstandard getch() to handle your keyboard input - but beware, it's not supported on all compilers and the input is non-buffered. That being said, there's no C/C++ standard for asynchronous input as far as I know, so using getch() is your best bet.
Using variables to keep track of the object's location, you can then draw it using Turbo's
http://www.onecore.net/turbo-c-graphics-programming.htm
Hope this helps
Using variables to keep track of the object's location, you can then draw it using Turbo's
graphics.h file. There's more information about Turbo graphics here:http://www.onecore.net/turbo-c-graphics-programming.htm
Hope this helps
Last edited by John A; Dec 31st, 2006 at 6:28 pm. Reason: fixed link
"Technological progress is like an axe in the hands of a pathological criminal."
All my posts may be freely redistributed under the terms of the MIT license.
All my posts may be freely redistributed under the terms of the MIT license.
•
•
•
•
hey thanx...but i want to know the exact syntax i need to write to make a rectangle move when a user presses the right or left key. I'm new to Turbo c++ and i would really need all the help i can get.
Thanx a lot
There is no "exact" syntax for doing what you want.. How you accomplish it is entirely up to you, although you need to learn the basics first, then you'll know what options you have available to you.
¿umop apisdn upside down? ![]() |
Similar Threads
- Moving objects on a form (VB.NET)
- Java Applet viewer blinks everytime the init method is used. (Java)
Other Threads in the C++ Forum
- Previous Thread: how to make computer beep
- Next Thread: Problem to write C program
| Thread Tools | Search this Thread |
api array arrays based beginner binary bitmap c++ c/c++ calculator char class classes code compile compiler console conversion count data delete deploy desktop directshow dll download dynamic encryption error file forms fstream function functions game getline givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory news node number output parameter pointer problem program programming project proxy python random read recursion recursive return string strings struct temperature template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






