Hey I am making a game and i can make the character jump, but i am trying to make the character land on an object. I am trying to do this with object collision but im not sure how. My code for jumping for an image with a certain height is below. I was trying to do it when the character jumps to a certain height and collides with an object, its new location on the screen will be on top of the object but i am not sure how to add that in. any suggestions would be great.
//METHOD TO JUMP
public void jump(){
if(peak == false)
v--;//character jumping
if(v == 250)//max height for jump
peak = true;
if(peak == true && v <= 300){//returning to ground
v++;
if(v == 300){
done = true;
}
}
}