-
-
Save codeforfun-jp/9060635953e7511f6896436b52434627 to your computer and use it in GitHub Desktop.
CTB 4-4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void changePos() { | |
if (action_flg) { | |
boxY -= 20; | |
} else { | |
boxY += 20; | |
} | |
box.setY(boxY); | |
} | |
@Override | |
public boolean onTouchEvent(MotionEvent event) { | |
if (event.getAction() == MotionEvent.ACTION_DOWN) { | |
action_flg = true; | |
} else if (event.getAction() == MotionEvent.ACTION_UP) { | |
action_flg = false; | |
} | |
return true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment