I'm trying to have allow the user to press and hold the screen to increase the force of a jump (note jspeed2
). I'm using the below code, but it doesn't do what I need.
Any suggestions?
case MotionEvent.ACTION_DOWN: {
if (x < 600 && jspeed2 < 28) {
jspeed2++;
}
}
case MotionEvent.ACTION_UP: {
if (x < 600) {
player.jump();
}
}