Back to project page gameengine.
The source code is released under:
Apache License
If you think the Android project gameengine listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.garrapeta.gameengine; // w ww .j a v a 2s .c o m import com.garrapeta.gameengine.utils.LogX; public abstract class AsyncGameMessage extends GameMessage { public AsyncGameMessage() { this(MESSAGE_PRIORITY_DEFAULT); } public AsyncGameMessage(int priority) { mPriority = priority; } @Override public final void onPosted(final GameWorld world) { Runnable runnable = new Runnable() { @Override public void run() { synchronized (world) { if (world.isRunning()) { try { doInBackground(); world.add(AsyncGameMessage.this); } catch (Throwable t) { LogX.e(GameWorld.TAG, "Error happening in async message", t); world.onError(t); } } } } }; world.executeAsynchronously(runnable); } public abstract void doInBackground(); }