[Help needed] Ball game

Hello everyone,

I have a problem creating this 2D game project I’ve been working on. Basically I am trying to make a game in unity similar to this flash game: Tigers kycklingstuds - Spela spel nu! - Chicken Dash - Webbspel - Spela gratisspel, gratis, webbyrå, webbkampanjer, Gävle, Stockholm

The setup i have is two cubes, one on each side of the game with a small platform in the middle that can move 3 places between the boxes with the arrow keys. I have a ball that I want the player to get to the other side from one box to the other.

The problem I have as for now is how to get the ball to move from the first box to the other one and bounce 3 times between. (see the picture for better understanding)
http://imageshack.us/photo/my-images/17/2dgamep.jpg/

What is the best solution for this? Is it possible to make an animation so it looks nice and clean or should i use force to move it to the other side? If so, how do i go about doing something like that? If you see the game I linked earlier you’ll know what I want to achieve as far as the animation goes…

I have used a transform.position script for the platform in the middle that stops at 3 points between the boxes.

function Update(){

	if(Input.GetButtonDown("cA")){
	transform.position = Vector3(2,0,0);
        }
	if(Input.GetButtonDown("cS")){
        transform.position = Vector3(0,0,0);
	}

	if(Input.GetButtonDown("cD")){
        transform.position = Vector3(-2,0,0);
         }

}

I want the ball to hit those positions 3 times, if the player misses then i want the ball to fall down.
I’ve been trying to achieve this effect for several days now with no luck so I am now asking the forum’s intelligent people for help :slight_smile:

Let me know if i weren’t specific enough or if you are having trouble understanding me,

Thank you!

Anyone?