We are about to switch to a new forum software. Until then we have removed the registration on this forum.
trying to turn this circle into a line (point) that will walk back and forth across the screen. This is where I'm at, knowing it's way off in a strange direction. Please help.
color bgColor = color(0); // black
color drawColor = color(255, 255, 255, 255); // white
float t = 0;
float n = noise(t);
float x = map (n, 0,1,0,width);
float y = map (n, 0,1,0,height);
void setup() {
size(900, 650);
background(bgColor);
}
void draw () {
ellipse (x, 31,14,14);
t += 0.01;
}
class Walker {
float x,y;
float tx,ty;
Walker() {
tx = 0;
ty = 10000;
}
void step() {
x = map(noise(tx), 0, 1, 0, width);
y = map(noise(tx), 0, 1, 0, height);
tx += 0.01;
ty += 0.01;
}
}
Answers
where do you use ty?
I thought that was time * y-coordinate. This may be an example of how lost I am?
Did you read the tutorial on oop now? Oop means object oriented programming.
You have a class walker but don't use it.
Also you should have background at the start of draw()
Anyway t will just increase all the time
Your description is also very short
Do you want line or point? Do you want to generate a curve? Left or downwards?
To make progress say
x= radius * sin(t) + 120;
Read on sin in Wikipedia
This is how you'd get the walker the work. Click to create new walkers.