Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean onTouchEvent(MotionEvent event) {
- Log.i(LOG_TAG, "Canvas touched");
- if (event.getAction() == MotionEvent.ACTION_DOWN) {
- if (event.getX() > 960) {
- Log.i(LOG_TAG, "Moving player right");
- gameEngine.onRelease();
- gameEngine.onClickRight();
- } else {
- Log.i(LOG_TAG, "Moving player left");
- gameEngine.onRelease();
- gameEngine.onClickLeft();
- }
- }
- if (event.getAction() == MotionEvent.ACTION_UP) {
- gameEngine.onRelease();
- }
- return super.onTouchEvent(event);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement