public void pauseClick(View v) { if (gameEngine != null && gameEngine.hasBeenInitialized()) { if (gameEventManager.getGameState() == GAME_STATE.PLAYING) { Log.d(TAG, "un pausing Game"); pauseButton.setText("Resume"); gameEventManager.pauseGame(); } else if (gameEventManager.getGameState() == GAME_STATE.PAUSED) { Log.d(TAG, "Pausing Game"); pauseButton.setText("Pause"); gameEventManager.unPauseGame(); } } }
public void onSensorChanged(SensorEvent event) { if (gameEngine != null && gameEngine.hasBeenInitialized()) { float yValue = event.values[1]; gameEngine.setBallXVelocity(yValue); } }