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

ashmew2 (7)   Link to this post
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 (3179)   Link to this post
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.

This topic is archived - New replies not allowed.