Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在我的游戏中使用 cocos2d-x 睡几秒钟。代码是用 c++ 编写的,我将在 android 上使用它。我不想完全停止游戏,所以我不能在 C++ 中使用睡眠功能。我已经搜索了所有地方,但没有找到问题的答案。请帮帮我。
我认为唯一的选择是将该层写入某个线程并使用 thread_sleep(time) 你可以实现你的目标。
试试这个代码:
sleep(seconds);