We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hey! This is my first project using Processing. I decided to make a little landscape with a mouse-dependant animation of sunrise/sunset. It's obviously very crude, but my problem right now is I've only managed to make the moon/sun move on two mirrored lines, as opposed to a nice curve, which is what I'd really like. Can anyone offer their help? Here's what I have so far.
void setup() {
size(500,500);
}
void draw() {
noStroke();
if (mouseX<250) {
background(mouseX/0.98,mouseX/0.98,0);
fill(255,255-mouseX/0.98,255-mouseX/0.98);
ellipse(mouseX,150-mouseX/2.5,50,50);
} else {
background(255-(mouseX-250)/0.98,255-(mouseX-250)/0.98,0);
fill(255,(mouseX-250)/0.98,(mouseX-250)/0.98);
ellipse(mouseX,50.4+(mouseX-250)/2.5,50,50);
}
fill(23,122,11);
ellipse(80,220,100,100);
ellipse(265,250,230,200);
ellipse(500,310,200,300);
fill(40,180,20);
ellipse(0,270,230,230);
ellipse(150,280,230,190);
ellipse(260,275,120,120);
fill(30,215,7);
ellipse(55,370,250,250);
ellipse(235,380,200,175);
ellipse(415,320,320,300);
fill(26,255,0);
rect(0,400,500,100);
}
Answers