Your browser does not support the canvas tag.

previous        Show / Hide Source        Download        next
//This Assignment is an interactive processing window with changing dot colours and parallax
//Created by Sebastian Barkley for PROG14998 - P02

void setup() {
  //creates a window with 400x400 pixel size
  size(400, 400);  
  //removes cursor
  noCursor();
}

void draw() {
  background(0, 0, 0);

  //Removes stroke
  noStroke();
  //Sets rectangle mode to CORNERS
  rectMode(CORNERS);
  //Sets ellipse mode to CENTER
  ellipseMode(CENTER);  



  //Custom Triangle Cursor
  fill(255, 255, 255, 100);
  triangle(mouseX, mouseY-8, mouseX-8, mouseY+8, mouseX+8, mouseY+8);

  //Right Circle
  //Opacity changing according to Y axis
  fill(0, 0, 127, (mouseY-200)*2);
  ellipse(300, 200, 150, 150);
  //Top Left Square
  rect(25, 25, 50, 50);

  //Bottom Circle
  //Opacity changing according to X axis
  fill(0, 127, 0, (mouseX-200)*2);
  ellipse(200, 300, 150, 150);
  //Top Right Square
  rect(375, 25, 350, 50);

  //Top Circle
  fill(127, 127, 127, (200-mouseX)*2);
  ellipse(200, 100, 150, 150);
  //Bottom Left Square
  rect(25, 350, 50, 375);

  //Left Circle
  fill(127, 0, 0, (200-mouseY)*2);
  ellipse(100, 200, 150, 150);
  //Bottom Right Square
  rect(350, 350, 375, 375);

  //Background squares
  fill(127, 127, 0, 50);
  rect(25,25,50,50);
  rect(25,350,50,375);
  rect(350,350,375,375);
  rect(375,25,350,50);
  
  //Background ellipse
   ellipse(200, 300, 150, 150);
   ellipse(100, 200, 150, 150);
   ellipse(200, 100, 150, 150);
   ellipse(300, 200, 150, 150);
   
   
}