In keeping with the Disney franchises…

Yashraje
My Design Journey
2 min readSep 6, 2022

--

Welcome back. In this weeks iteration of My Design Journey, we’re drawing inspiration from another branch under Lord Mickey’s empire, Pixar. Specifically, the door sequence from the opening of Monsters Inc. I wanted to re-create how the doors come flying in randomly on the screen, and extending it to keep spawning new unique doors.

I’ve posted the code below, it’s interactive so feel free to copy it and see what kind of patterns you can make!

int rectWidth; // Width of the shape
int rectHeight; //Height
float xpos, ypos; // Starting position of shape

float xspeed = 1; // X Speed of the shape
float yspeed = 1; // Y Speed of the shape

int xdirection = 1; // Left or Right
int ydirection = 1; // Top to Bottom

void setup()
{
background(0);
size(600, 450); //set background
frameRate(24);
}

void draw()
{
//door coordinate points
xpos = random(0,width);
ypos = random(0,height);
//door dimensions
int rectWidth= (int)random(25,75);
int rectHeight= (int)random(25,150);

//function to draw doors
for(int i=0; i< 300; i++){
//set doorframe to be any colour that is cooler(more blue)
fill(random(75),random(75),random(255));
//door border to stand out on background
strokeWeight(0.5);
stroke(138,149,165);
rect(xpos, ypos, rectWidth, rectHeight); //Draw door frame
//Draw doorknob
fill(#FFBE0B);
ellipse((xpos+(rectWidth*0.66)),(ypos+(rectHeight/2)), 5,5);
}
}

--

--