Processing Assignment 1 (Updated)

For my Final Version of this assignment, I decided to continue making alterations to the if(mousePressed) code and added some color changing text that follows the mouse wherever it is moved and stops in its path once it is pressed. Besides this, I decided to insert a picture (specifically of a party hat) to fit in with my idea of confetti and chaos, which appears when the mouse is clicked and dragged around the screen. The background remained the same shade of black it originally was set to and little change was made to the color fill of the shapes.

 

My Code (Final Version)

PImage img;

void setup() {
size (600, 400);
background(0, 0, 0);
img = loadImage(“partyhat.jpg”);
fill(mouseX, mouseY, 100);

}
void draw() {
image(img, 65, 250, 70, 70);
frameRate(20);
stroke(10);
if (mouseY<640);
if (mousePressed) {
ellipse(mouseX, mouseY, 28, 28);
rect(mouseX, 15, mouseY, 10);
triangle(mouseX, 35, mouseY, 35, 100, 250);
fill(random(150, 255), random(150, 255), random(150, 255));
{
}

if (mouseX<75);
if (mousePressed) {
stroke(1);
ellipse(mouseY, Y, 30, 30);
rect(mouseX, mouseY, 20, 20);
fill(random(150, 255), random(150, 255), random(150, 255));
fill(random(150, 255), random(150, 255), random(150, 255));
}
if (mouseX>420)
strokeWeight(1);
rotate(mouseX / 100.0);
textSize(32);
}

{
{{
if (mouseX>50)
translate(mouseX, mouseY);
textSize(30);
text(“Time”, 10, 30);
fill(random(150, 255), random(150, 255), random(150, 255));
translate(mouseX, mouseY);
text(“to”, 10, 30);
fill(random(150, 255), random(150, 255), random(150, 255));
translate(mouseX, mouseY);
text(“Party”, 10, 30);
fill(random(150, 255), random(150, 255), random(150, 255));
}}}}