Using keyboard events

Advice please:

public void change This function will increment the y2 of the 2nd ellipse by 2. Use the short cut operator for the assignment. If the y2 is greater than height, reset the y2 to 30.

this is what i have so far–

public void change()
if (y2>height);

What is this? What do you think?


okay…i figured that part out…

where would i look to find out how to make my ellipse move up and down?

create a program that creates two balls using the ellipse function. One will be controlled by the keyboard using the UP, DOWN, LEFT, RIGHT keys. The other will fall vertically and return to a random x location at the top if it reaches the bottom

Look, make yourself familiar with the examples.

Otherwise you will keep asking for every single small step.

We already pointed you to the motion section of the example section of the website


NEVER make a ; at this point

it ends the if clause.


As an example

compare this correct code :

if (3==4) 

with this wrong code:

if (3==4);

Do you see the problem? Exactly.