cplusplus.com
C++ : Forum : Windows Programming : C++ Functions. Run two at a Time.
 
cplusplus.com
Information
Documentation
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs


post C++ Functions. Run two at a Time.

ashmew2 (7)
Hi , i was wondering , how to run more than one function at the same time . I am basically trying to make a snake game in C++.
If you have a block falling function and another character move function , what can you do so that the block is falling as well as the character is moving?
Thanks.
Bazzy (6258)
To run two functions simultaneously you need to use multi-threading.
In your case, you can make a loop in which functions are executed sequentially and each function moves the falling block or the character not for the entire distance but just a bit of that so that the result would be that the user will see the block an the character moving at the same time.
Topic archived. No new replies allowed.