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;
			}
		}
	}

No idea what your code is supposed to do.
Can you explain your problem in terms of x and y values?
You have a character at one x,y location and an object at another x,y location.
Then what do you want to happen?
How are the x,y values changing for the two items in question?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.