I'm trying to make a shooting video game in conole mode but the game pauses to recieve an input from the key board. Ho can I get around this? How do game engines work? DFor exaple in a game like pac-man where the ghosts and other elements in the game work in real-time independently of the player's input, how can I achiev this in console mode?
CodeBoy101 -2 Junior Poster in Training
Recommended Answers
Jump to Post>Ho can I get around this?
You'll have to learn about working with multiple threads or multiple processes. That's a rather broad and complicated topic for a forum post though, try google.
Jump to PostYou don't need threads, just a means of reading all your input device(s) without blocking.
For example, this.
Jump to Post>So if I don't need to use multithreading how can I get
>around having to wait for an input from the user?
If you need to do something that would be accomplished by multithreading, why do you think you don't need multithreading? You could spawn multiple processes, but I get …
All 12 Replies
Narue 5,707 Bad Cop Team Colleague
CodeBoy101 commented: Very helpful, he gave the perfect solution! +1
Salem 5,265 Posting Sage
phalaris_trip 5 Junior Poster in Training
CodeBoy101 -2 Junior Poster in Training
Salem 5,265 Posting Sage
CodeBoy101 -2 Junior Poster in Training
Narue 5,707 Bad Cop Team Colleague
Salem 5,265 Posting Sage
CodeBoy101 -2 Junior Poster in Training
CodeBoy101 -2 Junior Poster in Training
jbennet 1,618 Most Valuable Poster Team Colleague Featured Poster
CodeBoy101 -2 Junior Poster in Training
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.