I was doing my coding and try to make the Pacman game using Dev c++ , but I had a problem to use my arrow key as control the pacman and how to make the screen stayed while playing the game . please help mee thanks
Asked
Active
Viewed 382 times
0
-
1What is specifically the problem? Are you asking how to capture arrow key input? Also, I'm not sure what you mean regarding the screen. – Collin Jun 12 '19 at 15:35
-
Im sorry my english so bad . What I mean is usually when we input a data using cin>> we need to press "Enter" button to proceed to the next command , but what I want is we only need to press the specific key example no "1" to proceed without pressing "Enter" button. And how to control the pacman( player ) using the arrow key in my coding. Sorry – Superfire353 Jun 12 '19 at 15:42
1 Answers
0
What you want to do is to listen to keyboard events and update characters on the console output memory in a non-blocking way.
One way to do it is to interface with your operating system API that provide such interface.
If you use windows I did a minimal game to learn how to do this myself.
If you use linux the API are different. You can also use cross platform IDE like QT or libraries, like the very old conio.h.

05032 Mendicant Bias
- 571
- 1
- 5
- 15
-
1Blimey those massive banner comments in every function!! – Lightness Races in Orbit Jun 12 '19 at 16:18