I am developing a game for Android using a game engine. I want the pause and resume button on the game screen.
I implemented this with MenuScene and to pause the game I use
engine.stop();
But as soon as he stops the engine, he does not start any touch events or clicks.
How to start the engine again?
or what could be the best way to do the same?
Well, although I am not a pro and I do not know, I can give some advice. First of all, stopping the engine is not the pause solution you are looking for. So instead you should do it manuelly, which I mean:
: yourPhysicsWorld.unregisterPhysicsConnector(), . (setVelocity(0,0))
yourPhysicsWorld.unregisterPhysicsConnector()
setVelocity(0,0)
: yourScene.unregisterUpdateHandler()
yourScene.unregisterUpdateHandler()
: , . , , , SQLite SharePreferences Google.
SQLite
SharePreferences
, , .
, :
mScene.setIgnoreUpdate(true); mScene.setChildScene(mPauseScene, false, true, true);
mScene - , mPauseScene - .
mScene
mPauseScene
, , :
mScene.clearChildScene(); mScene.setIgnoreUpdate(false);
/, . , . , .
To pause a game:
GameScene.gameScene.setChildScene(pauseScreen, false, true, true);
add these lines to your Screen.So game that your game will pause
Resume game:
GameScene.gameScene.clearChildScene();
Source: https://habr.com/ru/post/1529403/More articles:how to get url value after question mark in javascript - javascriptIs it possible to specify an example of executable files for the library as optional in the cabal package? - haskellБудет ли добавлен некластеризованный индекс блокировки моей таблицы? - sqljUnit in Eclipse throws null pointer exception - javamaxRequestLength in web.config makes an internal error - asp.netsimple form translation - ruby | fooobar.comPHP Extended Array Combinations - phpHow to clear cache server for Windows 8 browser - c #Использование BAT файла для автоматического повторного подключения VPN-Cisco к отказу подключения - batch-file"ORA-14450: attempt to access an existing transactional temp table" in a compound trigger - oracleAll Articles