How to animate so the ball keeps on moving and how to scale per keyboard input

How DO I animate so the ball keeps on moving and how do i scale per keyboard input?

1) Below is a code which moves the ball towards the target once the z key is pressed incrementing it once per click so I have to keep on pressing z. How can I just animate the ball so it continues until it hits the target?

void keyPressed (unsigned char key, int x, int y) {

if (key == 'z') {

Ballz = Ballz - Speed;
Bally = Bally + 2.8;

}

I tried

Ballx++
Bally++
Bally++

But even that doesn't animate

2) Basically we have to add two levers/bars or rectangles so for example when i press the left key the lever is supposed to increase on the x axis showing the user is aiming left

I have 2 problems in this section, I've done both levers or bars but its only displayed on the scene when it's on line loop and not polygon...

b) I'm trying to scale the bars every time a left or right arrow key is pressed, so for example if I press left the x axis on the leftrightbar has to scale towards the left, how can this be done?

This is too vague. What happens when you run this? Do you get any graphics at all?

Do you know if your TimerFunc is even getting called? Use your debugger or print
statements to see if it's being called.

It's good you posted your code. It helps the forum to help you. But you should take
it a bit further by enclosing the code in [ code] and [ /code] tags. Use indenting to
make it more readable, and leave out stuff not pertinent to your question. In other
words, post a simplified, cleaned up, version of your code that we can compile and
run.