void setup() {
size(400, 800);
fill(0, 0, 255);
}
float x = 100;
float y = 700;
float hizY = -30;
float hizX = 0;
int yercekimi = 1;
void draw() {
background(255, 255, 255);
ellipse(x, y, 40, 40);
y = y + hizY;
if (y > height-20) {
y = y - hizY;
hizY = -1 * hizY;
}
x = x + hizX;
if (x > width-20 || x < 20) {
x = x - hizX;
hizX = -1 * hizX;
}
hizY = hizY + yercekimi;
}
void mousePressed() {
if (mouseButton == LEFT) {
hizX = hizX - 2;
} else {
hizX = hizX + 2;
}
}