@Override public void draw(Canvas canvas) { if (mRunScript && mScriptExecutor != null) { if (Combat.IsActive()) { Combat.Draw(canvas); } mScriptExecutor.draw(canvas); } else if (Combat.IsActive()) { Combat.Draw(canvas); return; } else { drawScene(canvas); } }
@Override public void onKeyDown(int key) { if (mRunScript && mScriptExecutor != null) { mScriptExecutor.keyDown(key); } else if (Combat.IsActive()) { Combat.KeyDown(key); return; } else if (mPlayer != null) { switch (key) { case Global.KEY_LEFT: walkLeft(); break; case Global.KEY_RIGHT: walkRight(); break; case Global.KEY_UP: walkUp(); break; case Global.KEY_DOWN: walkDown(); break; case Global.KEY_ENTER: triggerSceneObjEvent(); break; } } }
@Override public void onKeyUp(int key) { if (mRunScript && mScriptExecutor != null) { mScriptExecutor.keyUp(key); } else if (Combat.IsActive()) { Combat.KeyUp(key); return; } else if (key == Global.KEY_CANCEL) { GameView.getInstance().pushScreen(new ScreenGameMainMenu()); } }
@Override public void update(long delta) { if (mRunScript && mScriptExecutor != null) { mScriptExecutor.process(); mScriptExecutor.update(delta); } else if (Combat.IsActive()) { // TODO fix this test Combat.Update(delta); } else { for (int i = 1; i <= 40; i++) { if (mNPCObj[i] == null) continue; mNPCObj[i].update(delta); } } }