trapped – week 2


My main goal -after using for/while loops- was to use the random function that is built-in processing to make an interactive artwork. I used the random function to get different hues of blue (for the ocean) and yellow (for the goldfish). I started with the circles that make the moving water up. I did not -at that point- think of it as water; I just wanted to experiment how the piece would look like with random different shades of a certain color would look like. I happen to like blues and so I started with them.

When I saw the result I immediately thought of the ocean, hence, inspiration?? To put the for loops into use I put nets as they match the theme as well. As for the fish, I thought it would be cool to have another interactive part for this. The fish’s color changes color as well (it’s not so obvious though) because it’s a shimmery goldfish.


float xValue;
float yValue;
float Rdecimal;
float Bdecimal;
int xCenterOfFish;
int yCenterOfFish;

int R;
int B;

void setup() {

  size (300, 300);

void draw(){
// random r values for the water
  xValue = random(width);
  yValue = random(height);
  Rdecimal = random (100, 200);
  int R = int(Rdecimal);

// circles that make the water up
  fill (R, 255, 244);
  ellipse(xValue, yValue, 50, 50);
// random b values for the water
Bdecimal = random (23, 100);
  int B = int(Bdecimal);

// to draw the fish when mouse is pressed
      if (mousePressed == true) {
        xCenterOfFish = mouseX;
        yCenterOfFish = mouseY;
        fill(235, 188, B);
        circle (xCenterOfFish, yCenterOfFish, 22);
        triangle(xCenterOfFish, yCenterOfFish, xCenterOfFish+20, yCenterOfFish+10, xCenterOfFish+20, yCenterOfFish-10);

  // net horizontally
  stroke (0);
  for (int i = 0; i < height; i = i+5) {
  line(width, i, 0, i);
  // net vertically
stroke (0);
  for (int i = 0; i < width; i = i+4) {
  line(i, height, i, 0);




Leave a Reply