Ass­i­g­n­m­e­n­t 1

by Lisa Miller
  • Show Code
  • Show Sketch
/** @peep sketch */
/** @peep sketchcode */
 
//SKETCH 1.1 (DRAFT)
 
void setup() {
size(400, 400);
 background(45, 42, 50);
 noStroke();
 
 
 fill(158, 128, 20);
rect(199, 0, 2, 350);
 
 fill(158, 128, 20);
quad(180, 105, 220, 105, 230, 130, 170, 130);
 
fill(158, 128, 20);
quad( 170, 280, 230, 280, 220, 295, 180, 295);
 
fill(142, 113, 22);
quad(183, 295, 217, 295, 213, 299, 187, 299);
 
fill(158, 128, 20);
quad(190, 299, 210, 299, 212, 316, 188, 316);
 
fill(158, 128, 20);
bezier(196, 350, 196, 325, 204, 325, 204, 350);
 
fill(111, 53, 62);
ellipse(200, 330, 6, 6);
 
 
fill(111, 53, 62);
ellipse(200, 200, 262, 163);
 
 fill(105, 45, 55);
ellipse(200, 200, 243, 163);
 
fill(111, 53, 62);
ellipse(200, 200, 220, 163);
 
 fill(105, 45, 55);
ellipse(200, 200, 185, 163);
 
fill(111, 53, 62);
ellipse(200, 200, 167, 163);
 
 fill(105, 45, 55);
ellipse(200, 200, 111, 163);
 
fill(111, 53, 62);
ellipse(200, 200, 90, 163);
 
 
 fill(235, 186, 2);
ellipse(200, 200, 76, 76);
 
 fill(240, 199, 79);
ellipse(200, 200, 64, 64);
 
 fill(244, 213, 129);
ellipse(200, 200, 35, 35);
 
 
 
}
  • Show Code
  • Show Sketch
/** @peep sketch */
/** @peep sketchcode */
 
//FINAL SKETCH
 
void setup() {
size(400, 400);
 background(45, 42, 50);
 noStroke();
 
//RANDOM GENERATORS
 
float r = random(20, 100); //opacity of background circles
float p = random(0, 100); //movement of lantern along y axis
float q = random(-50, 50); //movement of lantern along x axis
 
/*
BACKGROUND CIRCLES - for loops to generate 6 circles and catagorised into 
colour based on size (2 of each colour). These circels position has been 
made radom using "random" and the opacity has been made random but united 
using "r".
*/
  for (int a = 35; a > 5; a -= 5) { 
 
    if (a > 30) { 
  fill(235, 186, 2, r); 
} 
if ((a > 16) && (a < 26)){ 
   fill(240, 199, 79, r); 
} 
 if ((a > 0) && (a < 16)){ 
  fill(244, 213, 129, r);
} 
 
  ellipse(random(20, 380), random (20, 380), a, a);
 
}
/*
//LANTERN STEM - a series of different shaped quads, ellipses and beziers. Attached 
to these shapes are random generators "p" and "q", These have been subtracted 
from the y and x axis, to move the shapes randomly but united across the screen.
*/
 
 fill(158, 128, 20);
rect(199-q, 0-p, 2, 350);
 
 fill(158, 128, 20);
quad(180-q, 105-p, 220-q, 105-p, 230-q, 130-p, 170-q, 130-p);
 
fill(158, 128, 20);
quad( 170-q, 275-p, 230-q, 275-p, 220-q, 295-p, 180-q, 295-p);
 
fill(142, 113, 22);
quad(183-q, 295-p, 217-q, 295-p, 213-q, 299-p, 187-q, 299-p);
 
fill(158, 128, 20);
quad(190-q, 299-p, 210-q, 299-p, 212-q, 316-p, 188-q, 316-p);
 
fill(158, 128, 20);
bezier(196-q, 350-p, 196-q, 325-p, 204-q, 325-p, 204-q, 350-p);
 
fill(111, 53, 62);
ellipse(200-q, 330-p, 6, 6);
 
/*
LANTERN - a series of for loops have been created using condititional statments to apply 
 and change the colour of various layers of the circle to create a stripe effect. The 
 "if" conditional has been used to target specific layers to create the 3 stripes.
 The "else" conditional has been used to save the effort of inidviually cataogrising 
 all the remaining layers.More for loops have been created than necessary to create the 
 effect of thin and thick stripes.
*/
for (int l = 225; l > 70; l -= 5) { 
 
  if (((l > 91) && (l < 106)) || ((l > 151) && (l < 166)) || 
  ((l > 211) && (l < 226))) 
   { 
  fill(130, 34, 18);
 } else { 
   fill(145, 34, 25);
} ellipse(200-q, 200-p, l, 163);
 
}
 
// CENTRE CIRCLES - for loops to create 3 circles inside each other.
 
for (int a = 80; a > 30; a -= 20) { 
 
  if (a > 79) { 
  fill(235, 186, 2, 190); 
} 
if ((a > 45) && (a < 61)){ 
   fill(240, 199, 79, 190); 
} 
 if ((a > 0) && (a < 41)){ 
  fill(244, 213, 129, 190);
} 
  ellipse(200-q, 200-p, a, a);
 
}
  }

Comments

Nobody has said anything yet.