-
-
Save codeforfun-jp/01c148aad1fdc6c3eeb377dadf4b1720 to your computer and use it in GitHub Desktop.
CTB 4-1
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
private float boxY; | |
// Handler & Timer | |
private Handler handler = new Handler(); | |
private Timer timer = new Timer(); | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
// ------------ | |
// --- 省略 --- | |
// ------------ | |
boxY = 500.0f; | |
timer.schedule(new TimerTask() { | |
@Override | |
public void run() { | |
handler.post(new Runnable() { | |
@Override | |
public void run() { | |
changePos(); | |
} | |
}); | |
} | |
}, 0, 20); | |
} | |
@Override | |
public boolean onTouchEvent(MotionEvent event) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment