i want to use that in a snake game, i made the snake move but i can't control him ....
...how can i read a key without stoping the looping...
if i use getch() it stops till i stroke any key...and the snake stops,then after i press another key makes another move and so on

...or if is possible to use the arrows

Recommended Answers

All 2 Replies

Member Avatar for iamthwee

1.Post your compiler and your operating system, and preferably which variant of the C language you are using if you intend to get a reply

2.If you are making this game from the command line be aware of the obvious limitations.

3.Look into using kbhit() instead. Although this command is not portable but may serve your purpose.

c++, xp, in command line, it has no design, is made from displaing letters with gotoxy()... thanks for the tip, i'll try this at home...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.