/*int option=1;
int xPos=200;
int xDir=1;
void setup() {
size(500, 500);
}
void draw() {
background(165,78,78);
stroke(240,160,160);
for(int x=0; x<width; x=x+20){
line(x,0,x,height);
for (int y=0; y<height; y=y+20){
line(0,y,width, y);
}
}
println (mouseX, mouseY);
strokeWeight(2);
if (option==1) {
for (int circleX=70; circleX<= 225; circleX +=70) {
for (int circleY=70; circleY<= 475; circleY+=70) {
fill(random(255), 255, 255);
stroke(228,255,77);
ellipse(circleX, 80, 50, 50);
ellipse(circleY, 80, 50, 50);
ellipse(circleX, 160, 50, 50);
ellipse(circleY, 160, 50, 50);
ellipse(circleX, 240, 50, 50);
ellipse(circleY, 240, 50, 50);
ellipse(circleX, 320, 50, 50);
ellipse(circleY, 320, 50, 50);
ellipse(circleX, 400, 50, 50);
ellipse(circleY, 400, 50, 50);
}
}
}
if (option==2) {
background(222,180,65);
stroke(0);
for(int x=0; x<width; x=x+20){
line(x,0,x,height);
for (int y=0; y<height; y=y+20){
line(0,y,width, y);
}
}
for (int circleX=70; circleX<= 225; circleX +=70) {
for (int circleY=70; circleY<= 475; circleY+=70) {
fill(random(400), 23, 78);
stroke(0);
{
ellipse(circleX, 239, 119,119);
ellipse(circleY, 239, 119, 119);
fill(0);
}
fill(random(400), 23, 78);
ellipse(circleX, 160, 50, 50);
ellipse(circleY, 160, 50, 50);
ellipse(circleX, 240, 50, 50);
ellipse(circleY, 240, 50, 50);
ellipse(circleX, 320, 50, 50);
ellipse(circleY, 320, 50, 50);
ellipse(circleX, 400, 50, 50);
ellipse(circleY, 400, 50, 50);
}
}
}
if (option==3) {
background(30,142,122);
stroke(50,80,30);
for(int x=0; x<width; x=x+20){
line(x,0,x,height);
for (int y=0; y<height; y=y+20){
line(0,y,width, y);
}
}
for (int circleX=70; circleX<= 225; circleX +=70) {
for (int circleY=70; circleY<= 475; circleY+=70) {
fill(random(240), 240,125);
stroke(228,255,77);
rect(circleX, 80, 60, 60,7);
ellipse(circleY, 80, 50, 50);
rect(circleX, 160, 60, 60,7);
ellipse(circleY, 160, 50, 50);
rect(circleX, 240, 60, 60,7);
ellipse(circleY, 240, 50, 50);
rect(circleX, 320, 60, 60,7);
ellipse(circleY, 320, 50, 50);
rect(circleX, 400, 60, 60,7);
ellipse(circleY, 400, 50, 50);
}
}
}
if (option==4){
background(88,85,84);
for(int x=0; x<width; x=x+20){
line(x,0,x,height);
for (int y=0; y<height; y=y+20){
line(0,y,width, y);
}
}
for (int circleX=70; circleX<= 225; circleX +=70) {
for (int circleY=70; circleY<= 475; circleY+=70) {
fill(random(95), 100, 62);
stroke(300,300,300);
ellipse(xPos, 80, 50, 50);
ellipse(xPos, 80, 50, 50);
xPos=xPos+xDir;
if (xPos>width-10 || xPos<10)
{
xDir=-xDir;
}
ellipse(circleX, 160, 50, 50);
ellipse(circleY, 160, 50, 50);
ellipse(xPos, 240, 50, 50);
ellipse(xPos, 240, 50, 50);
xPos=xPos+xDir;
if (xPos>width-10 || xPos<10)
{
xDir=-xDir;
}
ellipse(circleX, 320, 50, 50);
ellipse(circleY, 320, 50, 50);
ellipse(xPos, 400, 50, 50);
ellipse(xPos, 400, 50, 50);
xPos=xPos+xDir;
if (xPos>width-10 || xPos<10)
{
xDir=-xDir;
}
}
}
}
if (option==5) {
background(104,116,27);
stroke(248,252,13);
for(int x=0; x<width; x=x+20){
line(x,0,x,height);
for (int y=0; y<height; y=y+20){
line(0,y,width, y);
}
}
for (int circleX=70; circleX<= 225; circleX +=70) {
for (int circleY=70; circleY<= 475; circleY+=70) {
fill(random(213), 219, 181);
stroke(228,255,77);
ellipse(circleX, 80, 50, 50);
ellipse(circleY, 80, 50, 50);
ellipse(circleX, 160, 50, 50);
ellipse(circleY, 160, 50, 50);
ellipse(circleX, 240, 50, 50);
ellipse(circleY, 240, 50, 50);
ellipse(circleX, 320, 50, 50);
ellipse(circleY, 320, 50, 50);
ellipse(circleX, 400, 50, 50);
ellipse(circleY, 400, 50, 50);
}
}
}
}
void keyPressed() {
option++;
if (option>5) {
option=1;
}
}
*/
int option=1;
int xPos=200;
int xDir=1;
void setup() {
size(500, 500);
}
void draw() {
background(165,78,78);
stroke(240,160,160);
for(int x=0; x<width; x=x+20){
line(x,0,x,height);
for (int y=0; y<height; y=y+20){
line(0,y,width, y);
}
}
println (mouseX, mouseY);
strokeWeight(2);
if (option==1) {
for (int circleX=70; circleX<= 225; circleX +=70) {
for (int circleY=70; circleY<= 475; circleY+=70) {
fill(random(255), 255, 255);
stroke(228,255,77);
ellipse(circleX, 80, 50, 50);
ellipse(circleY, 80, 50, 50);
ellipse(circleX, 160, 50, 50);
ellipse(circleY, 160, 50, 50);
ellipse(circleX, 240, 50, 50);
ellipse(circleY, 240, 50, 50);
ellipse(circleX, 320, 50, 50);
ellipse(circleY, 320, 50, 50);
ellipse(circleX, 400, 50, 50);
ellipse(circleY, 400, 50, 50);
}
}
}
if (option==2) {
background(222,180,65);
stroke(0);
for(int x=0; x<width; x=x+20){
line(x,0,x,height);
for (int y=0; y<height; y=y+20){
line(0,y,width, y);
}
}
for (int circleX=70; circleX<= 225; circleX +=70) {
for (int circleY=70; circleY<= 475; circleY+=70) {
fill(random(400), 23, 78);
stroke(0);
{
ellipse(circleX, 239, 119,119);
ellipse(circleY, 239, 119, 119);
fill(0);
}
fill(random(400), 23, 78);
ellipse(circleX, 160, 50, 50);
ellipse(circleY, 160, 50, 50);
ellipse(circleX, 240, 50, 50);
ellipse(circleY, 240, 50, 50);
ellipse(circleX, 320, 50, 50);
ellipse(circleY, 320, 50, 50);
ellipse(circleX, 400, 50, 50);
ellipse(circleY, 400, 50, 50);
}
}
}
if (option==3) {
background(30,142,122);
stroke(50,80,30);
for(int x=0; x<width; x=x+20){
line(x,0,x,height);
for (int y=0; y<height; y=y+20){
line(0,y,width, y);
}
}
for (int circleX=70; circleX<= 225; circleX +=70) {
for (int circleY=70; circleY<= 475; circleY+=70) {
fill(random(240), 240,125);
stroke(228,255,77);
rect(circleX, 80, 60, 60,7);
ellipse(circleY, 80, 50, 50);
rect(circleX, 160, 60, 60,7);
ellipse(circleY, 160, 50, 50);
rect(circleX, 240, 60, 60,7);
ellipse(circleY, 240, 50, 50);
rect(circleX, 320, 60, 60,7);
ellipse(circleY, 320, 50, 50);
rect(circleX, 400, 60, 60,7);
ellipse(circleY, 400, 50, 50);
rect(circleY, 80, 60, 60,7);
rect(circleY, 160, 60, 60,7);
rect(circleY, 240, 60, 60,7);
rect(circleY, 320, 60, 60,7);
rect(circleY, 400, 60, 60,7);
}
}
}
if (option==4){
background(88,85,84);
for(int x=0; x<width; x=x+20){
line(x,0,x,height);
for (int y=0; y<height; y=y+20){
line(0,y,width, y);
}
}
for (int circleX=70; circleX<= 225; circleX +=70) {
for (int circleY=70; circleY<= 475; circleY+=70) {
fill(random(95), 100, 62);
stroke(300,300,300);
rect(xPos, 80, 50, 50);
rect(xPos, 80, 50, 50);
xPos=xPos+xDir;
if (xPos>width-10 || xPos<10)
{
xDir=-xDir;
}
ellipse(circleX, 160, 50, 50);
ellipse(circleY, 160, 50, 50);
rect(xPos, 240, 50, 50);
rect(xPos, 240, 50, 50);
xPos=xPos+xDir;
if (xPos>width-10 || xPos<10)
{
xDir=-xDir;
}
ellipse(circleX, 320, 50, 50);
ellipse(circleY, 320, 50, 50);
rect(xPos, 400, 50, 50);
rect(xPos, 400, 50, 50);
xPos=xPos+xDir;
if (xPos>width-10 || xPos<10)
{
xDir=-xDir;
}
}
}
}
if (option==5) {
background(104,116,27);
stroke(248,252,13);
for(int x=0; x<width; x=x+20){
line(x,0,x,height);
for (int y=0; y<height; y=y+20){
line(0,y,width, y);
}
}
for (int circleX=70; circleX<= 225; circleX +=70) {
for (int circleY=70; circleY<= 475; circleY+=70) {
fill(random(213), 219, 181);
stroke(228,255,77);
ellipse(circleX, 80, 50, 50);
ellipse(circleY, 80, 50, 50);
ellipse(circleX, 160, 50, 50);
ellipse(circleY, 160, 50, 50);
ellipse(circleX, 240, 50, 50);
ellipse(circleY, 240, 50, 50);
ellipse(circleX, 320, 50, 50);
ellipse(circleY, 320, 50, 50);
ellipse(circleX, 400, 50, 50);
ellipse(circleY, 400, 50, 50);
if (circleX ==10);
for (int i = 0; i < 100; i++) {
float r = random(-500, 500);
fill(random(238),75,131);
rect(r+i,r+i,r+i,r+i);
}
}
}
}
}
void keyPressed() {
option++;
if (option>5) {
option=1;
}
}
Comments
Post a Comment