Easy Pattern ... needs some fixing
in
Programming Questions
•
10 months ago
Hey guys,
On my way to university i wrote a little pattern program, which i want to be able to be configured with a GUI later on. But atm i am stuck on the speed paramater. As soon as i want to change speed settings inside my integer the whole progress isn't working anymore.
Here's the Code:
On my way to university i wrote a little pattern program, which i want to be able to be configured with a GUI later on. But atm i am stuck on the speed paramater. As soon as i want to change speed settings inside my integer the whole progress isn't working anymore.
Here's the Code:
- int x = 0;
int y = 0;
int speed = 40;
int versatz = 5;
void setup() {
size (600, 600);
smooth();
background (80);
noStroke();
}
void draw () {
x = x + speed;
fill (random(255), random(255), random (255), 100);
ellipse (x, y , 40, 40);
if (x >= width) {
speed = speed * -1;
y = y + versatz;
}
if (x <= 0) {
speed = speed * -1;
y = y + versatz;
}
if (y >= height) {
versatz = versatz * -1;
save("picture1.tif");
}
if (y <= 0) {
versatz = versatz * -1;
}
}
I hope you find the mistake ... i tried so many versions so far that i just didn't know where else to go. It's just a logical error i think.
glad to hear some new perspektives
cheers
swift
glad to hear some new perspektives
cheers
swift
1