Final Project

sketchDownload
//global variables
var houseDayImg;
var houseNightImg;
var dayPeriod = 2000;
var numTrees = 4;
var numStars = 20;
var trees = [];
var stars = [];

class Star {
    constructor() {
        this.x = random(width);
        this.y = random(height/4);
    }

    display() {
        fill(255,255,255);
        ellipse(this.x, this.y, 3, 3);
    }
}

class Tree {
    constructor() {
        var choice = random(1);
        if(choice < 0.5){
            this.x = random(width/3);  
        }else {
            this.x = random(2 * width / 3, width - 10); 
        }
        choice = random(1);
        if(choice < 0.5){
            this.color = color(135, 167, 126);  
        }else {
            this.color = color(73, 126, 97);
        }
        this.y = random(280, 300)
        this.w = random(50, 70);
        this.h = random(60, 90);
    }
       
    display() {
        fill(109, 86, 53);
        rect(this.x - 5, this.y + 10, 10, 50);
        fill(this.color)
        ellipse(this.x, this.y, this.w, this.h);
    }
}

function preload() {
    //preload images
    houseDayImg = loadImage("https://i.imgur.com/DguMSkN.png");
    houseNightImg = loadImage("https://i.imgur.com/eXNWSkN.png");
    panelImg = loadImage("https://i.imgur.com/VFf1Rr8.png");
    batteryImg = loadImage("https://i.imgur.com/rw8ScZs.png");
}

function setup() {
    createCanvas(400, 400);
    for(i = 0; i < numStars; i++){ //draw stars at night
        stars.push(new Star())
    }
    
    for(i = 0; i < numTrees; i++){ //draw trees
        trees.push(new Tree())
    }

}

function draw() {
    time = frameCount % dayPeriod;
    bgDark = time;
    batteryLife = (frameCount + dayPeriod / 4) % dayPeriod;
    if (bgDark > dayPeriod/2) {
        bgDark = dayPeriod - bgDark;
    }
    if (batteryLife > dayPeriod/2) {
        batteryLife = dayPeriod - batteryLife;
    }
    background(207 - bgDark / dayPeriod*255*2, 226 - bgDark / dayPeriod*255*2, 243 - bgDark / dayPeriod*255*2);

    //ground
    fill(143-bgDark*(143-66)/dayPeriod*2, 206-bgDark*(206-95)/dayPeriod*2, 0);
    noStroke();
    ellipse(200, 400, 500, 180);
    
    //panel
    image(panelImg, 125, 156, 80, 80);
    
    //battery
    image(batteryImg, 140, -15, 100, 100);
    fill(255 - batteryLife / dayPeriod * 255 * 2, batteryLife / dayPeriod * 255 * 2, 0);
    rect(167, 18, batteryLife / dayPeriod * 61 * 2, 34);
  
    //during daytime
    if (time < dayPeriod/4 || time > dayPeriod*3/4) {
       
       //house
       image(houseDayImg, 130, 200, 130, 130);

    } else { //during nighttime
       
        //house 
        drawStars();
        image(houseNightImg, 130, 200, 130, 130);
   }

    frameCount += 1;

    //function
    drawSun(time);
    drawTrees();
}


function drawSun(time) { 
   push();
   translate(200, 400);
    rotate(frameCount * 2 * PI / dayPeriod);
   fill(255, 206, 59);
   ellipse(0, -300, 70, 70);
   pop();
}

function drawStars() { //draw stars at random locations in the sky when it becomes night and disappear when it becomes daytime again
    for(i = 0; i < stars.length; i++){
        stars[i].display();
    }
}

function drawTrees(){ //draw trees at random locations every time you refresh 
    for(i = 0; i < trees.length; i++){
        trees[i].display();
    }
}

For the final project, I created an information visualization inspired by Tesla’s solar roof. I wanted to illustrate this scene by using solar roof because I thought this type of clean energy production can help lower the emissions of greenhouse gases and carbon dioxide, and further decrease our reliance to fossil fuels to create a better environment. During the day, the solar roof is charged with solar energy, illustrated by a battery icon being gradually charged up as the sun moves throughout the daytime. Then, when it becomes night, the battery icon will be fully charged, allowing the house to brightly light up even in the dark. For a little detail, after the sun goes down during the day, the stars will show up representing nighttime. Every time the user refreshes the screen, the trees will randomly appear in random locations as well as the stars. This was an amazing opportunity for me to explore using various techniques like array, object, loop, conditional, transformation, and functions, and I think I truly enjoyed creating this illustration. Hope you enjoy! 🙂

Final Project

My project is an interactive story, describing the pre-industrial, industrial, and post-industrial scenes of the society. It is meant to let people see how industrialization has affected our everyday life scene. At the start page, viewers could press a, or b, or c to see the corresponding scene. After each scene is finished, it will automatically return to the start page, and then viewers could press another key option to see a different scene. I got my inspiration from the children’s illustration books. All the scenes are composite by drawn characters. Also, the scenes are drawn with easily understood logic. If I have more time, I probably would add lines to each scene to tell a story, add more animation, like smokes coming out of the factories, and add sounds into it.
storyDownload
/*Name:Camellia(Siyun) Wang; 
Section: C; 
Email Address: siyunw@andrew.cmu.edu;
Assignment-14;*/

//start page
var page = "start";

//scene1
var meadows = [];
var cows1 = [];
var cows1n = [];
var cows2 = [];
var cows2b = [];
var groups = [];
var horses = [];
var horses2 = [];
var cows3 = [];
var birds = [];
var mountains = [];

//scene2
var meadows2 = [];
var cows12 = [];
var cows1n2 = [];
var cows22 = [];
var cows2b2 = [];
var groups2 = [];
var houses = [];
var houses2 = [];
var birds2 = [];
var mountains2 = [];
var factorys = [];
var skys = [];
var towns = [];

//scene3
var angle = 0;
var ices1 = [];
var ices1n = [];
var ices2 = [];
var ices2b = [];
var ices2c = [];
var ices3 = [];
var bears = [];
var penguins = [];
var factorys2 = [];
var seas = [];
var droughts = [];

function preload(){
    //startpage
    sun = loadImage("https://courses.ideate.cmu.edu/15-104/f2021/wp-content/uploads/2021/12/sun.png");
    pre = loadImage("https://courses.ideate.cmu.edu/15-104/f2021/wp-content/uploads/2021/12/pre-pic.png");
    indus = loadImage("https://courses.ideate.cmu.edu/15-104/f2021/wp-content/uploads/2021/12/industrial-pic.png");
    post = loadImage("https://courses.ideate.cmu.edu/15-104/f2021/wp-content/uploads/2021/12/post-pic.png");

    //scene1
    backgroundImage = loadImage("https://courses.ideate.cmu.edu/15-104/f2021/wp-content/uploads/2021/12/back.jpeg");
    mountain = loadImage("https://courses.ideate.cmu.edu/15-104/f2021/wp-content/uploads/2021/12/mountains.png")
    cow1 = loadImage("https://courses.ideate.cmu.edu/15-104/f2021/wp-content/uploads/2021/12/cow1.png");
    cow2 = loadImage("https://courses.ideate.cmu.edu/15-104/f2021/wp-content/uploads/2021/12/cow2.png");
    sheeps = loadImage("https://courses.ideate.cmu.edu/15-104/f2021/wp-content/uploads/2021/12/sheeps.png");
    horse = loadImage("https://courses.ideate.cmu.edu/15-104/f2021/wp-content/uploads/2021/12/horse.png");
    meadow = loadImage("https://courses.ideate.cmu.edu/15-104/f2021/wp-content/uploads/2021/12/background.png");
    cow3 = loadImage("https://courses.ideate.cmu.edu/15-104/f2021/wp-content/uploads/2021/12/cow3.png");
    bird = loadImage("https://courses.ideate.cmu.edu/15-104/f2021/wp-content/uploads/2021/12/birds.png");

    //scene2
    sky = loadImage("https://courses.ideate.cmu.edu/15-104/f2021/wp-content/uploads/2021/12/sky.png");
    mountain2 = loadImage("https://courses.ideate.cmu.edu/15-104/f2021/wp-content/uploads/2021/12/mountain.png");
    meadow2 = loadImage("https://courses.ideate.cmu.edu/15-104/f2021/wp-content/uploads/2021/12/meadow.png");
    house = loadImage("https://courses.ideate.cmu.edu/15-104/f2021/wp-content/uploads/2021/12/house.png");
    house2 = loadImage("https://courses.ideate.cmu.edu/15-104/f2021/wp-content/uploads/2021/12/house2.png");
    factory = loadImage("https://courses.ideate.cmu.edu/15-104/f2021/wp-content/uploads/2021/12/factory-1.png");
    town = loadImage("https://courses.ideate.cmu.edu/15-104/f2021/wp-content/uploads/2021/12/town.png");

    //scene3
    sea = loadImage("https://courses.ideate.cmu.edu/15-104/f2021/wp-content/uploads/2021/12/sea.png");
    bear = loadImage("https://courses.ideate.cmu.edu/15-104/f2021/wp-content/uploads/2021/12/polar-bear.png");
    penguin = loadImage("https://courses.ideate.cmu.edu/15-104/f2021/wp-content/uploads/2021/12/penguin.png");
    ice1 = loadImage("https://courses.ideate.cmu.edu/15-104/f2021/wp-content/uploads/2021/12/iceburg2.png");
    ice2 = loadImage("https://courses.ideate.cmu.edu/15-104/f2021/wp-content/uploads/2021/12/iceburg3.png");
    ice3 = loadImage("https://courses.ideate.cmu.edu/15-104/f2021/wp-content/uploads/2021/12/iceburg1.png");
    factory2 = loadImage("https://courses.ideate.cmu.edu/15-104/f2021/wp-content/uploads/2021/12/factory.png");
    drought = loadImage("https://courses.ideate.cmu.edu/15-104/f2021/wp-content/uploads/2021/12/deforestation.png");
}

function setup() {
    createCanvas(480, 400); 

    //scene1
    //the meadow
    var mea = makeMeadow(1,400);
    meadows.push(mea);
    //the mountain
    var mon = makeMountain(120,50);
    mountains.push(mon);
    //cow1
    var cow1 = makeCow1(150,250);
    cows1.push(cow1);
    //cow1n
    var cow1n = makeCow1n(1100,270);
    cows1n.push(cow1n);
    //cow2
    var cow2 = makeCow2(610,240);
    cows2.push(cow2);
    //group
    var gro = makeGroup(650,280);
    groups.push(gro);
    //horse
    var hor = makeHorse(300,190);
    horses.push(hor);
    //horse2
    var hor2 = makeHorse2(900,150);
    horses2.push(hor2);
    //cow3
    var cow3 = makeCow3(1200,325);
    cows3.push(cow3);
    //bird
    var bird = makeBird(1220,25);
    birds.push(bird);


    //scene2
    //the town
    var town = makeTown(810,-20);
    towns.push(town);
    // the sky
    var sky = makeSky(0,100);
    skys.push(sky);
    //the meadow
    var mea2 = makeMeadow2(1,400);
    meadows2.push(mea2);
    //the mountain
    var mon2 = makeMountain2(1,50);
    mountains2.push(mon2);
    //cow12
    var cow12 = makeCow12(50,220);
    cows12.push(cow12);
    //cow1n2
    var cow1n2 = makeCow1n2(150,200);
    cows1n2.push(cow1n2);
    //cow2
    var cow22 = makeCow22(240,220);
    cows22.push(cow22);
    //group
    var gro2 = makeGroup2(600,260);
    groups2.push(gro2);
    //house
    var hou = makeHouse(550,-20);
    houses.push(hou);
    //house2
    var hou2 = makeHouse2(450,50);
    houses2.push(hou2);
    //factory
    var fac = makeFactory(1050,40);
    factorys.push(fac);
    //bird
    var bird2 = makeBird2(1220,25);
    birds2.push(bird2);


    //scene3
    // the sea
    var se = makeSea(1,1);
    seas.push(se);
    //the bear
    var bea = makeBear(600,150);
    bears.push(bea);
    //the penguin
    var pen = makePenguin(50,200);
    penguins.push(pen);
    //ice1
    var ic1 = makeIce1(1,5);
    ices1.push(ic1);
    //ice1n
    var ic1n = makeIce1n(500,120);
    ices1n.push(ic1n);
    //ice2
    var ic2 = makeIce2(250,200);
    ices2.push(ic2);
    //ice2b
    var ic2b = makeIce2b(890,240);
    ices2b.push(ic2b);
    //ice2c
    var ic2c = makeIce2c(830,220);
    ices2c.push(ic2c);
    //ice3
    var ic3 = makeIce3(550,140);
    ices3.push(ic3);
    //factory
    var fac2 = makeFactory2(1000,0);
    factorys2.push(fac2);
    //the drought
    var dro = makeDrought(2000,0);
    droughts.push(dro);

    frameRate(50);
}

function keyPressed(){
    if(key == "0"){
        page = "start";
    }
    else if(key == "a"){
        page = "scene1";
    }
    else if(key == "b"){
        page = "scene2"
    }
    else if(key == "c"){
        page = "scene3"
    }
}


function draw() {
    //startpage:
    if(page == "start"){
        background(143,188,143);
        var i = 0;
        while(i <= width){
            push();
            translate(90+i,310);
            rotate(radians(angle));
            imageMode(CENTER);
            image(sun, 0, 0, 100,100);
            pop();
            angle += 1;
            i = i+150;
        }
        textSize(25);
        text('How Industrialization Changed Our Life',25,70);
        image(pre,30,125,120,150);
        image(indus,180,125,120,150);
        image(post,330,125,120,150);
        textSize(15);
        text('Pre-Industrial',45,120);
        text('Industrial',210,120);
        text('Post-Industrial',345,120);
         //message at bottom
        fill(0);
        textSize(15);
        text("Please type a to see Pre-Industrial, b to see Industrial,",30, height - 35);
        text("and c to see Post-Industrial. Press 0 to reset", 30, height - 15);
    }

    //scene1
    if(page == "scene1"){
         background(backgroundImage);

        updateAndDisplayMountain();
        removeMountainThatHaveSlippedOutOfView();

        updateAndDisplayHorse2();
        removeHorse2ThatHaveSlippedOutOfView();

        updateAndDisplayMeadow();
        removeMeadowThatHaveSlippedOutOfView();

        updateAndDisplayHorse();
        removeHorseThatHaveSlippedOutOfView();

        updateAndDisplayCow2();
        removeCow2ThatHaveSlippedOutOfView();

        updateAndDisplayBird();
        removeBirdThatHaveSlippedOutOfView();

        updateAndDisplayGroup();
        removeGroupThatHaveSlippedOutOfView();

        updateAndDisplayCow1();
        removeCow1ThatHaveSlippedOutOfView();
        updateAndDisplayCow1n();
        removeCow1nThatHaveSlippedOutOfView();

        updateAndDisplayCow3();
        removeCow3ThatHaveSlippedOutOfView();
    }

    else if(page == "scene2"){
        background(255);
        updateAndDisplaySky();
        removeSkyThatHaveSlippedOutOfView();

        updateAndDisplayHouse2();
        removeHouse2ThatHaveSlippedOutOfView();

        updateAndDisplayMountain2();
        removeMountain2ThatHaveSlippedOutOfView();

        updateAndDisplayFactory();
        removeFactoryThatHaveSlippedOutOfView();

        updateAndDisplayTown();
        removeTownThatHaveSlippedOutOfView();

        updateAndDisplayMeadow2();
        removeMeadow2ThatHaveSlippedOutOfView();


        updateAndDisplayHouse();
        removeHouseThatHaveSlippedOutOfView();

        updateAndDisplayCow22();
        removeCow22ThatHaveSlippedOutOfView();

        updateAndDisplayBird2();
        removeBird2ThatHaveSlippedOutOfView();

        updateAndDisplayGroup2();
        removeGroup2ThatHaveSlippedOutOfView();

        updateAndDisplayCow12();
        removeCow12ThatHaveSlippedOutOfView();
        updateAndDisplayCow1n2();
        removeCow1n2ThatHaveSlippedOutOfView();
    }

    else if(page == "scene3"){
        background(255);

        updateAndDisplaySea();
        removeSeaThatHaveSlippedOutOfView();

        updateAndDisplayFactory2();
        removeFactory2ThatHaveSlippedOutOfView();

        updateAndDisplayDrought();
        removeDroughtThatHaveSlippedOutOfView();

        updateAndDisplayIce1();
        removeIce1ThatHaveSlippedOutOfView();

        updateAndDisplayIce1n();
        removeIce1nThatHaveSlippedOutOfView();

        updateAndDisplayIce2();
        removeIce2ThatHaveSlippedOutOfView();

        updateAndDisplayIce2c();
        removeIce2cThatHaveSlippedOutOfView();

        updateAndDisplayIce2b();
        removeIce2bThatHaveSlippedOutOfView();

        updateAndDisplayIce3();
        removeIce3ThatHaveSlippedOutOfView();

        updateAndDisplayBear();
        removeBearThatHaveSlippedOutOfView();

        updateAndDisplayPenguin();
        removePenguinThatHaveSlippedOutOfView();
    }

    
}



//scene 1: Pre-industrial


//the meadow
function makeMeadow(xm,ym) {
    var M = {
        x: xm, 
        y: ym,
        move: meadowMove,
        speed: -1,
        display: meadowDisplay};
    return M;
}

function meadowMove() {
    this.x += this.speed;
}

function meadowDisplay(xm) {
   image(meadow, this.x, 0,1400,400);
}

function updateAndDisplayMeadow(){
    for(var i = 0; i < meadows.length; i++){
        meadows[i].move();
        meadows[i].display();
    }
}

function removeMeadowThatHaveSlippedOutOfView(){
    for (var i = 0; i < meadows.length; i++){
        if (meadows[i].x == -900) {
            page = "start";
        }
    }
}

//the mountain
function makeMountain(xmo,ymo) {
    var Mo = {
        x: xmo, 
        y: ymo,
        move: mountainMove,
        speed: -1,
        display: mountainDisplay};
    return Mo;
}

function mountainMove() {
    this.x += this.speed;
}

function mountainDisplay(xmo) {
   image(mountain, this.x, 0,1200,430);
}

function updateAndDisplayMountain(){
    for(var i = 0; i < mountains.length; i++){
        mountains[i].move();
        mountains[i].display();
    }
}

function removeMountainThatHaveSlippedOutOfView(){
    for (var i = 0; i < mountains.length; i++){
        if (mountains[i].x < -1440) {
            mountains.shift(mountains[i]);
        }
    }
}

//cow1
function makeCow1(xc1,yc1){
    var C1 = {
        x: xc1, 
        y: yc1,
        move: cow1Move,
        speed: -1,
        display: cow1Display};
    return C1;
}

function cow1Move(){
    this.x +=this.speed;
}

function cow1Display(xc1,yc1){
    image(cow1, this.x, this.y,100,80);
}

function updateAndDisplayCow1(){
    for(var i = 0; i < cows1.length; i++){
        cows1[i].move();
        cows1[i].display();
    }
}

function removeCow1ThatHaveSlippedOutOfView(){
    for (var i = 0; i < cows1.length; i++){
        if (cows1[i].x < -1440) {
            cows1.shift(cows1[i]);
        }
    }
}

//cow1n
function makeCow1n(xc1n,yc1n){
    var C1n = {
        x: xc1n, 
        y: yc1n,
        move: cow1nMove,
        speed: -1,
        display: cow1nDisplay};
    return C1n;
}

function cow1nMove(){
    this.x +=this.speed;
}

function cow1nDisplay(xc1,yc1){
    image(cow1, this.x, this.y,100,80);
}

function updateAndDisplayCow1n(){
    for(var i = 0; i < cows1n.length; i++){
        cows1n[i].move();
        cows1n[i].display();
    }
}

function removeCow1nThatHaveSlippedOutOfView(){
    for (var i = 0; i < cows1n.length; i++){
        if (cows1n[i].x < -1440) {
            cows1n.shift(cows1n[i]);
        }
    }
}



//cow2
function makeCow2(xc2,yc2){
    var C2 = {
        x: xc2, 
        y: yc2,
        move: cow2Move,
        speed: -1,
        display: cow2Display};
    return C2;
}

function cow2Move(){
    this.x +=this.speed;
}

function cow2Display(xc2,yc2){
    image(cow2, this.x, this.y,150,150);
}

function updateAndDisplayCow2(){
    for(var i = 0; i < cows2.length; i++){
        cows2[i].move();
        cows2[i].display();
    }
}

function removeCow2ThatHaveSlippedOutOfView(){
    for (var i = 0; i < cows2.length; i++){
        if (cows2[i].x < -1440) {
            cows2.shift(cows2[i]);
        }
    }
}


//group
function makeGroup(xg,yg){
    var G = {
        x: xg, 
        y: yg,
        move: groupMove,
        speed: -1,
        display: groupDisplay};
    return G;
}

function groupMove(){
    this.x +=this.speed;
}

function groupDisplay(xg,yg){
    image(sheeps, this.x, this.y,150,150);
}

function updateAndDisplayGroup(){
    for(var i = 0; i < groups.length; i++){
        groups[i].move();
        groups[i].display();
    }
}

function removeGroupThatHaveSlippedOutOfView(){
    for (var i = 0; i < groups.length; i++){
        if (groups[i].x < -1440) {
            groups.shift(groups[i]);
        }
    }
}


//horse
function makeHorse(xw,yw){
    var W = {
        x: xw, 
        y: yw,
        move: horseMove,
        speed: -1,
        display: horseDisplay};
    return W;
}

function horseMove(){
    this.x +=this.speed;
}

function horseDisplay(xw,yw){
    image(horse, this.x, this.y,200,200);
}

function updateAndDisplayHorse(){
    for(var i = 0; i < horses.length; i++){
        horses[i].move();
        horses[i].display();
    }
}

function removeHorseThatHaveSlippedOutOfView(){
    for (var i = 0; i < horses.length; i++){
        if (horses[i].x < -1440) {
            horses.shift(horses[i]);
        }
    }
}

//horse2
function makeHorse2(xw2,yw2){
    var W2= {
        x: xw2, 
        y: yw2,
        move: horse2Move,
        speed: -1,
        display: horse2Display};
    return W2;
}

function horse2Move(){
    this.x +=this.speed;
}

function horse2Display(xw2,yw2){
    image(horse, this.x, this.y,200,200);
}

function updateAndDisplayHorse2(){
    for(var i = 0; i < horses2.length; i++){
        horses2[i].move();
        horses2[i].display();
    }
}

function removeHorse2ThatHaveSlippedOutOfView(){
    for (var i = 0; i < horses2.length; i++){
        if (horses2[i].x < -1440) {
            horses2.shift(horses2[i]);
        }
    }
}

//cows3
function makeCow3(xs,ys){
    var S = {
        x: xs, 
        y: ys,
        move: cow3Move,
        speed: -1,
        display: cow3Display};
    return S;
}

function cow3Move(){
    this.x +=this.speed;
}

function cow3Display(xs,ys){
    image(cow3, this.x, this.y,75,75);
}

function updateAndDisplayCow3(){
    for(var i = 0; i < cows3.length; i++){
        cows3[i].move();
        cows3[i].display();
    }
}

function removeCow3ThatHaveSlippedOutOfView(){
    for (var i = 0; i < cows3.length; i++){
        if (cows3[i].x < -1440) {
            cows3.shift(cows3[i]);
        }
    }
}


//birds
function makeBird(xf,yf){
    var F = {
        x: xf, 
        y: yf,
        move: birdMove,
        speed: -2.0,
        display: birdDisplay};
    return F;
}

function birdMove(){
    this.x +=this.speed;
}

function birdDisplay(xf,yf){
    image(bird, this.x, this.y,200,200);
}

function updateAndDisplayBird(){
    for(var i = 0; i < birds.length; i++){
        birds[i].move();
        birds[i].display();
    }
}

function removeBirdThatHaveSlippedOutOfView(){
    for (var i = 0; i < birds.length; i++){
        if (birds[i].x < -1440) {
            birds.shift(birds[i]);
        }
    }
}

//scene 2: Industrial


//the town
function makeTown(xt,yt) {
    var T = {
        x: xt, 
        y: yt,
        move: townMove,
        speed: -1,
        display: townDisplay};
    return T;
}

function townMove() {
    this.x += this.speed;
}

function townDisplay(xt,yt) {
   image(town, this.x,this.y ,700,700);
}

function updateAndDisplayTown(){
    for(var i = 0; i < towns.length; i++){
        towns[i].move();
        towns[i].display();
    }
}

function removeTownThatHaveSlippedOutOfView(){
    for (var i = 0; i < towns.length; i++){
        if (towns[i].x < -1440) {
            towns.shift(towns[i]);
        }
    }
}

//the factory
function makeFactory(xf,yf) {
    var F = {
        x: xf, 
        y: yf,
        move: factoryMove,
        speed: -1,
        display: factoryDisplay};
    return F;
}

function factoryMove() {
    this.x += this.speed;
}

function factoryDisplay(xf,yf) {
   image(factory, this.x, this.y,350,350);
}

function updateAndDisplayFactory(){
    for(var i = 0; i < factorys.length; i++){
        factorys[i].move();
        factorys[i].display();
    }
}

function removeFactoryThatHaveSlippedOutOfView(){
    for (var i = 0; i < factorys.length; i++){
        if (factorys[i].x < -1440) {
            factorys.shift(factorys[i]);
        }
    }
}

// the sky
function makeSky(xs,ys) {
    var S = {
        x: xs, 
        y: ys,
        move: skyMove,
        speed: -1,
        display: skyDisplay};
    return S;
}

function skyMove() {
    this.x += this.speed;
}

function skyDisplay(xb) {
   image(sky, this.x, 0,1800,400);
}

function updateAndDisplaySky(){
    for(var i = 0; i < skys.length; i++){
        skys[i].move();
        skys[i].display();
    }
}

function removeSkyThatHaveSlippedOutOfView(){
    for (var i = 0; i < skys.length; i++){
        if (skys[i].x < -1440) {
            skys.shift(skys[i]);
        }
    }
}

//the meadow2
function makeMeadow2(xm2,ym2) {
    var M2 = {
        x: xm2, 
        y: ym2,
        move: meadow2Move,
        speed: -1,
        display: meadow2Display};
    return M2;
}

function meadow2Move() {
    this.x += this.speed;
}

function meadow2Display(xm2) {
   image(meadow2, this.x, 0,1400,400);
}

function updateAndDisplayMeadow2(){
    for(var i = 0; i < meadows2.length; i++){
        meadows2[i].move();
        meadows2[i].display();
    }
}

function removeMeadow2ThatHaveSlippedOutOfView(){
    for (var i = 0; i < meadows2.length; i++){
        if (meadows2[i].x == -920) {
            page = "start";
        }
    }
}

//the mountain2
function makeMountain2(xmo2,ymo2) {
    var Mo2 = {
        x: xmo2, 
        y: ymo2,
        move: mountain2Move,
        speed: -1,
        display: mountain2Display};
    return Mo2;
}

function mountain2Move() {
    this.x += this.speed;
}

function mountain2Display(xmo2) {
   image(mountain2, this.x, 0,1400,400);
}

function updateAndDisplayMountain2(){
    for(var i = 0; i < mountains2.length; i++){
        mountains2[i].move();
        mountains2[i].display();
    }
}

function removeMountain2ThatHaveSlippedOutOfView(){
    for (var i = 0; i < mountains2.length; i++){
        if (mountains2[i].x < -1440) {
            mountains2.shift(mountains2[i]);
        }
    }
}

//cow12
function makeCow12(xc12,yc12){
    var C12 = {
        x: xc12, 
        y: yc12,
        move: cow12Move,
        speed: -1,
        display: cow12Display};
    return C12;
}

function cow12Move(){
    this.x +=this.speed;
}

function cow12Display(xc12,yc12){
    image(cow1, this.x, this.y,100,80);
}

function updateAndDisplayCow12(){
    for(var i = 0; i < cows12.length; i++){
        cows12[i].move();
        cows12[i].display();
    }
}

function removeCow12ThatHaveSlippedOutOfView(){
    for (var i = 0; i < cows12.length; i++){
        if (cows12[i].x < -1440) {
            cows12.shift(cows12[i]);
        }
    }
}

//cow1n2
function makeCow1n2(xc1n2,yc1n2){
    var C1n2 = {
        x: xc1n2, 
        y: yc1n2,
        move: cow1n2Move,
        speed: -1,
        display: cow1n2Display};
    return C1n2;
}

function cow1n2Move(){
    this.x +=this.speed;
}

function cow1n2Display(xc12,yc12){
    image(cow1, this.x, this.y,100,80);
}

function updateAndDisplayCow1n2(){
    for(var i = 0; i < cows1n2.length; i++){
        cows1n2[i].move();
        cows1n2[i].display();
    }
}

function removeCow1n2ThatHaveSlippedOutOfView(){
    for (var i = 0; i < cows1n2.length; i++){
        if (cows1n2[i].x < -1440) {
            cows1n2.shift(cows1n2[i]);
        }
    }
}



//cow22
function makeCow22(xc22,yc22){
    var C22 = {
        x: xc22, 
        y: yc22,
        move: cow2Move,
        speed: -1,
        display: cow22Display};
    return C22;
}

function cow22Move(){
    this.x +=this.speed;
}

function cow22Display(xc22,yc22){
    image(cow2, this.x, this.y,150,150);
}

function updateAndDisplayCow22(){
    for(var i = 0; i < cows22.length; i++){
        cows22[i].move();
        cows22[i].display();
    }
}

function removeCow22ThatHaveSlippedOutOfView(){
    for (var i = 0; i < cows22.length; i++){
        if (cows22[i].x < -1440) {
            cows22.shift(cows22[i]);
        }
    }
}


//group2
function makeGroup2(xg2,yg2){
    var G2 = {
        x: xg2, 
        y: yg2,
        move: group2Move,
        speed: -1,
        display: group2Display};
    return G2;
}

function group2Move(){
    this.x +=this.speed;
}

function group2Display(xg2,yg2){
    image(sheeps, this.x, this.y,150,150);
}

function updateAndDisplayGroup2(){
    for(var i = 0; i < groups2.length; i++){
        groups2[i].move();
        groups2[i].display();
    }
}

function removeGroup2ThatHaveSlippedOutOfView(){
    for (var i = 0; i < groups2.length; i++){
        if (groups2[i].x < -1440) {
            groups2.shift(groups2[i]);
        }
    }
}


//house
function makeHouse(xh,yh){
    var H = {
        x: xh, 
        y: yh,
        move: houseMove,
        speed: -1,
        display: houseDisplay};
    return H;
}

function houseMove(){
    this.x +=this.speed;
}

function houseDisplay(xh,yh){
    image(house, this.x, this.y,500,500);
}

function updateAndDisplayHouse(){
    for(var i = 0; i < houses.length; i++){
        houses[i].move();
        houses[i].display();
    }
}

function removeHouseThatHaveSlippedOutOfView(){
    for (var i = 0; i < houses.length; i++){
        if (houses[i].x < -1440) {
            houses.shift(houses[i]);
        }
    }
}

//house2
function makeHouse2(xh2,yh2){
    var H2= {
        x: xh2, 
        y: yh2,
        move: house2Move,
        speed: -1,
        display: house2Display};
    return H2;
}

function house2Move(){
    this.x +=this.speed;
}

function house2Display(xh2,yh2){
    image(house2, this.x, this.y,500,500);
}

function updateAndDisplayHouse2(){
    for(var i = 0; i < houses2.length; i++){
        houses2[i].move();
        houses2[i].display();
    }
}

function removeHouse2ThatHaveSlippedOutOfView(){
    for (var i = 0; i < houses2.length; i++){
        if (houses2[i].x < -1440) {
            houses2.shift(houses2[i]);
        }
    }
}


//birds2
function makeBird2(xb,yb){
    var B = {
        x: xb, 
        y: yb,
        move: bird2Move,
        speed: -2.0,
        display: bird2Display};
    return B;
}

function bird2Move(){
    this.x +=this.speed;
}

function bird2Display(xb,yb){
    image(bird, this.x, this.y,200,200);
}

function updateAndDisplayBird2(){
    for(var i = 0; i < birds2.length; i++){
        birds2[i].move();
        birds2[i].display();
    }
}

function removeBird2ThatHaveSlippedOutOfView(){
    for (var i = 0; i < birds2.length; i++){
        if (birds2[i].x < -1440) {
            birds2.shift(birds2[i]);
        }
    }
}


//scene 3: Post-industrial

//the drought
function makeDrought(xd,yd) {
    var D = {
        x: xd, 
        y: yd,
        move: droughtMove,
        speed: -1,
        display: droughtDisplay};
    return D;
}

function droughtMove() {
    this.x += this.speed;
}

function droughtDisplay(xd,yd) {
   image(drought, this.x,this.y ,1000,400);
}

function updateAndDisplayDrought(){
    for(var i = 0; i < droughts.length; i++){
        droughts[i].move();
        droughts[i].display();
    }
}

function removeDroughtThatHaveSlippedOutOfView(){
    for (var i = 0; i < droughts.length; i++){
        if (droughts[i].x == -450) {
            page = "start";
        }
    }
}

//the factory
function makeFactory2(xf2,yf2) {
    var F2 = {
        x: xf2, 
        y: yf2,
        move: factory2Move,
        speed: -1,
        display: factory2Display};
    return F2;
}

function factory2Move() {
    this.x += this.speed;
}

function factory2Display(xf2,yf2) {
   image(factory2, this.x, this.y,1000,400);
}

function updateAndDisplayFactory2(){
    for(var i = 0; i < factorys2.length; i++){
        factorys2[i].move();
        factorys2[i].display();
    }
}

function removeFactory2ThatHaveSlippedOutOfView(){
    for (var i = 0; i < factorys2.length; i++){
        if (factorys2[i].x < -1440) {
            factorys2.shift(factorys2[i]);
        }
    }
}

// the sea
function makeSea(xs,ys) {
    var S = {
        x: xs, 
        y: ys,
        move: seaMove,
        speed: -1,
        display: seaDisplay};
    return S;
}

function seaMove() {
    this.x += this.speed;
}

function seaDisplay(xb) {
   image(sea, this.x, 0,1400,400);
}

function updateAndDisplaySea(){
    for(var i = 0; i < seas.length; i++){
        seas[i].move();
        seas[i].display();
    }
}

function removeSeaThatHaveSlippedOutOfView(){
    for (var i = 0; i < seas.length; i++){
        if (seas[i].x < -1440) {
            seas.shift(seas[i]);
        }
    }
}

//the bear
function makeBear(xb,yb) {
    var B = {
        x: xb, 
        y: yb,
        move: bearMove,
        speed: -1,
        display: bearDisplay};
    return B;
}

function bearMove() {
    this.x += this.speed;
}

function bearDisplay(xb,yb) {
   image(bear, this.x, this.y,200,200);
}

function updateAndDisplayBear(){
    for(var i = 0; i < bears.length; i++){
        bears[i].move();
        bears[i].display();
    }
}

function removeBearThatHaveSlippedOutOfView(){
    for (var i = 0; i < bears.length; i++){
        if (bears[i].x < -1440) {
            bears.shift(bears[i]);
        }
    }
}

//the penguin
function makePenguin(xp,yp) {
    var P = {
        x: xp, 
        y: yp,
        move: penguinMove,
        speed: -1,
        display: penguinDisplay};
    return P;
}

function penguinMove() {
    this.x += this.speed;
}

function penguinDisplay(xp,yp) {
   image(penguin, this.x, this.y,400,400);
}

function updateAndDisplayPenguin(){
    for(var i = 0; i < penguins.length; i++){
        penguins[i].move();
        penguins[i].display();
    }
}

function removePenguinThatHaveSlippedOutOfView(){
    for (var i = 0; i < penguins.length; i++){
        if (penguins[i].x < -1440) {
            penguins.shift(penguins[i]);
        }
    }
}

//ice1
function makeIce1(xc1,yc1){
    var C1 = {
        x: xc1, 
        y: yc1,
        move: ice1Move,
        speed: -1,
        display: ice1Display};
    return C1;
}

function ice1Move(){
    this.x +=this.speed;
}

function ice1Display(xc1,yc1){
    image(ice1, this.x, this.y,400,400);
}

function updateAndDisplayIce1(){
    for(var i = 0; i < ices1.length; i++){
        ices1[i].move();
        ices1[i].display();
    }
}

function removeIce1ThatHaveSlippedOutOfView(){
    for (var i = 0; i < ices1.length; i++){
        if (ices1[i].x < -1440) {
            ices1.shift(ices1[i]);
        }
    }
}

//ice1n
function makeIce1n(xc1n,yc1n){
    var C1n = {
        x: xc1n, 
        y: yc1n,
        move: ice1nMove,
        speed: -1,
        display: ice1nDisplay};
    return C1n;
}

function ice1nMove(){
    this.x +=this.speed;
}

function ice1nDisplay(xc1,yc1){
    image(ice1, this.x, this.y,200,200);
}

function updateAndDisplayIce1n(){
    for(var i = 0; i < ices1n.length; i++){
        ices1n[i].move();
        ices1n[i].display();
    }
}

function removeIce1nThatHaveSlippedOutOfView(){
    for (var i = 0; i < ices1n.length; i++){
        if (ices1n[i].x < -1440) {
            ices1n.shift(ices1n[i]);
        }
    }
}



//ice2
function makeIce2(xc2,yc2){
    var C2 = {
        x: xc2, 
        y: yc2,
        move: ice2Move,
        speed: -1,
        display: ice2Display};
    return C2;
}

function ice2Move(){
    this.x +=this.speed;
}

function ice2Display(xc2,yc2){
    image(ice2, this.x, this.y,200,200);
}

function updateAndDisplayIce2(){
    for(var i = 0; i < ices2.length; i++){
        ices2[i].move();
        ices2[i].display();
    }
}

function removeIce2ThatHaveSlippedOutOfView(){
    for (var i = 0; i < ices2.length; i++){
        if (ices2[i].x < -1440) {
            ices2.shift(ices2[i]);
        }
    }
}


//ice2b
function makeIce2b(xw,yw){
    var W = {
        x: xw, 
        y: yw,
        move: ice2bMove,
        speed: -1,
        display: ice2bDisplay};
    return W;
}

function ice2bMove(){
    this.x +=this.speed;
}

function ice2bDisplay(xw,yw){
    image(ice2, this.x, this.y,200,200);
}

function updateAndDisplayIce2b(){
    for(var i = 0; i < ices2b.length; i++){
        ices2b[i].move();
        ices2b[i].display();
    }
}

function removeIce2bThatHaveSlippedOutOfView(){
    for (var i = 0; i < ices2b.length; i++){
        if (ices2b[i].x < -1440) {
            ices2b.shift(ices2b[i]);
        }
    }
}

//ice2c
function makeIce2c(xw2,yw2){
    var W2= {
        x: xw2, 
        y: yw2,
        move: ice2cMove,
        speed: -1,
        display: ice2cDisplay};
    return W2;
}

function ice2cMove(){
    this.x +=this.speed;
}

function ice2cDisplay(xw2,yw2){
    image(ice2, this.x, this.y,200,200);
}

function updateAndDisplayIce2c(){
    for(var i = 0; i < ices2c.length; i++){
        ices2c[i].move();
        ices2c[i].display();
    }
}

function removeIce2cThatHaveSlippedOutOfView(){
    for (var i = 0; i < ices2c.length; i++){
        if (ices2c[i].x < -1440) {
            ices2c.shift(ices2c[i]);
        }
    }
}


//ice3
function makeIce3(xf,yf){
    var F = {
        x: xf, 
        y: yf,
        move: ice3Move,
        speed: -1.0,
        display: ice3Display};
    return F;
}

function ice3Move(){
    this.x +=this.speed;
}

function ice3Display(xf,yf){
    image(ice3, this.x, this.y,300,300);
}

function updateAndDisplayIce3(){
    for(var i = 0; i < ices3.length; i++){
        ices3[i].move();
        ices3[i].display();
    }
}

function removeIce3ThatHaveSlippedOutOfView(){
    for (var i = 0; i < ices3.length; i++){
        if (ices3[i].x < -1440) {
            ices3.shift(ices3[i]);
        }
    }
}



Final Project: Reddit – Spaces of Climate Crisis

sketch

//Tim Nelson-Pyne
//tnelsonp
//Section C

var linksAntofu = ['https://i.imgur.com/Px1nV2B.jpg',
        'https://i.imgur.com/0Xd0GrB.png',
        'https://i.imgur.com/tAZFqHS.png',
        'https://i.imgur.com/mQenYYL.png',
        'https://i.imgur.com/49UZ1CQ.png',
        'https://i.imgur.com/zCeIB47.png',
        'https://i.imgur.com/bW5fsDf.png',
        'https://i.imgur.com/QqtjU1X.png',
        'https://i.imgur.com/PexfMHV.png',
        'https://i.imgur.com/KKu6Az2.png',
        'https://i.imgur.com/w55Ylwi.png',
        'https://i.imgur.com/86yrIIy.png',
        'https://i.imgur.com/xv63US1.png',
        'https://i.imgur.com/LfTmJHW.png',
        'https://i.imgur.com/qL8OCUJ.png',
        'https://i.imgur.com/RZlY9w8.png',
        'https://i.imgur.com/XTz4fVe.png',
        'https://i.imgur.com/8FZDSTa.png',
        'https://i.imgur.com/qBusraJ.png',
        'https://i.imgur.com/BpzmTcT.png',
        'https://i.imgur.com/YpxCZ1L.png',
        'https://i.imgur.com/8DXeLem.png',
        'https://i.imgur.com/a9pINWL.png',
        'https://i.imgur.com/jUFq33O.png',
        'https://i.imgur.com/xjQqAO1.png',
        'https://i.imgur.com/WXqNRVx.png',
        'https://i.imgur.com/gbkrwCj.png',
        'https://i.imgur.com/6gz20Vz.png',
        'https://i.imgur.com/UisuyPK.png',
        'https://i.imgur.com/tLvo8ln.png',
        'https://i.imgur.com/t2uQLf3.png',
        'https://i.imgur.com/mcsxD55.png',
        'https://i.imgur.com/rXMGQXS.png',
        'https://i.imgur.com/gbNnKhs.png',
        'https://i.imgur.com/9sp5SBc.png',
        'https://i.imgur.com/UEQJKrt.png'];


var linksClimatememes = [  'https://i.imgur.com/PyyxiE2h.png ',
 'https://i.imgur.com/Qaij15yh.jpg ',
 'https://i.imgur.com/9qBZVsfh.jpg ',
 'https://i.imgur.com/BHMNtHbh.jpg ',
 'https://i.imgur.com/lWpftgdh.jpg ',
 'https://i.imgur.com/7UoMKfdh.jpg ',
 'https://i.imgur.com/ljK0Pxmh.png ',
 'https://i.imgur.com/jC0tndfh.jpg ',
 'https://i.imgur.com/GEH3qEeh.jpg ',
 'https://i.imgur.com/4iAHEGsh.jpg ',
 'https://i.imgur.com/rEfIJiAh.png ',
 'https://i.imgur.com/FxxbBPgh.jpg ',
 'https://i.imgur.com/MZYveu9h.jpg ',
 'https://i.imgur.com/r4d9cuMh.jpg ',
 'https://i.imgur.com/TtWnYNQh.jpg ',
 'https://i.imgur.com/XWvhFzyh.jpg ',
 'https://i.imgur.com/lTNprgCh.jpg ',
 'https://i.imgur.com/z6vGesEh.jpg ',
 'https://i.imgur.com/JFel7Tch.jpg ',
 'https://i.imgur.com/PswaFlUh.jpg ',
 'https://i.imgur.com/dRpfRJ4h.jpg ',
 'https://i.imgur.com/McW5KTuh.jpg ',
 'https://i.imgur.com/Jy2LqDZh.jpg ',
 'https://i.imgur.com/P4bDHvQh.jpg ',
 'https://i.imgur.com/qHRRRMyh.jpg ',
 'https://i.imgur.com/gIa53RXh.png ',
 'https://i.imgur.com/bWA8mW1h.jpg ',
 'https://i.imgur.com/ZWKScsth.jpg ',
 'https://i.imgur.com/MaWfObgh.jpg ',
 'https://i.imgur.com/FyJglCGh.jpg ',
 'https://i.imgur.com/GuC0B1Uh.jpg ',
 'https://i.imgur.com/7ToxgQah.jpg ',
 'https://i.imgur.com/Vpn0Wslh.jpg ',
 'https://i.imgur.com/JMgByNHh.jpg ',
 'https://i.imgur.com/aHrVja4h.png ',
 'https://i.imgur.com/moAPzg9h.jpg ',
 'https://i.imgur.com/lj31aS9h.jpg ',
 'https://i.imgur.com/tvYMvjAh.jpg ',
 'https://i.imgur.com/2RKCCfGh.png ',
 'https://i.imgur.com/ZwIM1Plh.jpg ',
 'https://i.imgur.com/Ebojz1gh.jpg ',
 'https://i.imgur.com/uq4CIM3h.png ',
 'https://i.imgur.com/kyQ3Teih.jpg ',
 'https://i.imgur.com/H6vxpfEh.png ',
 'https://i.imgur.com/bifhKt0h.jpg ',
 'https://i.imgur.com/42350bEh.jpg ',
 'https://i.imgur.com/9jwG8PUh.png ',
 'https://i.imgur.com/ZBCUV8uh.png ',
 'https://i.imgur.com/6N1ldU6h.jpg ',
 'https://i.imgur.com/pq3NAamh.jpg ',
 'https://i.imgur.com/eOK1u5yh.jpg ',
 'https://i.imgur.com/pUWXHaKh.jpg ',
 'https://i.imgur.com/O23YUVNh.png ',
 'https://i.imgur.com/6HmLOVQh.png ',
 'https://i.imgur.com/YebJamjh.png ',
 'https://i.imgur.com/mfrCdV4h.png ',
 'https://i.imgur.com/3pOQ1Mph.png ',
 'https://i.imgur.com/LmdujUKh.png ',
 'https://i.imgur.com/ARcSLCWh.png ',
 'https://i.imgur.com/ZtRgLC9h.jpg ',
 'https://i.imgur.com/YxGZoaVh.jpg ',
 'https://i.imgur.com/h2tYvXah.jpg ',
 'https://i.imgur.com/WBpgFlah.png ',
 'https://i.imgur.com/oVDPrYzh.png ',
 'https://i.imgur.com/Jk2FS3gh.png ',
 'https://i.imgur.com/1yX6MrVh.jpg ',
 'https://i.imgur.com/ILVScKVh.jpg ',
 'https://i.imgur.com/MeAjx8jh.jpg ',
 'https://i.imgur.com/xl4E56Yh.jpg ',
 'https://i.imgur.com/2Hz0IgQh.png ',
 'https://i.imgur.com/I1PlN5rh.jpg ',
 'https://i.imgur.com/yGFtN21h.png ',
 'https://i.imgur.com/oGhbiGgh.jpg ',
 'https://i.imgur.com/iUOHEibh.jpg ',
 'https://i.imgur.com/X45RvOAh.jpg ',
 'https://i.imgur.com/8DMjVJsh.jpg ',
 'https://i.imgur.com/73Q2YJch.jpg ',
 'https://i.imgur.com/fOsT7Hrh.jpg ',
 'https://i.imgur.com/WdGVHsch.png ',
 'https://i.imgur.com/eqCtXMPh.png ',
 'https://i.imgur.com/x23X9B9h.png ',
 'https://i.imgur.com/EkVUfkxh.png ',
 'https://i.imgur.com/GCsbwG7h.png ',
 'https://i.imgur.com/PMKg9UNh.jpg ',
 'https://i.imgur.com/1gRZiWXh.png ',
 'https://i.imgur.com/sq7Jz1nh.jpg ',
 'https://i.imgur.com/cAmr84ah.jpg ',
 'https://i.imgur.com/7RuXyB0h.jpg ',
 'https://i.imgur.com/6EYcWgah.jpg ',
 'https://i.imgur.com/6jSUIZyh.jpg ',
 'https://i.imgur.com/kcQpLZhh.jpg ',
 'https://i.imgur.com/m03xcE9h.jpg ',
 'https://i.imgur.com/zRAdgyZh.jpg ',
 'https://i.imgur.com/IqbDugGh.jpg ',
 'https://i.imgur.com/DXQ2lOqh.jpg ',
 'https://i.imgur.com/lxrlGJoh.jpg ',
 'https://i.imgur.com/3hXMfSth.jpg ',
 'https://i.imgur.com/EpqBdiRh.jpg ',
 'https://i.imgur.com/ZebsPX7h.jpg ',
 'https://i.imgur.com/PkvNfBJh.gif '
];

var linksSustainability = [ 'https://i.imgur.com/u5ItRuxh.jpg ',
 'https://i.imgur.com/Sy2HAlOh.jpg ',
 'https://i.imgur.com/okRlVEwh.jpg ',
 'https://i.imgur.com/cqwu0PFh.jpg ',
 'https://i.imgur.com/8MLqLhDh.jpg ',
 'https://i.imgur.com/4VuEzAsh.jpg ',
 'https://i.imgur.com/wnBbGJrh.jpg ',
 'https://i.imgur.com/7kGAMzSh.jpg ',
 'https://i.imgur.com/K7gts3mh.jpg ',
 'https://i.imgur.com/xBVrR2nh.jpg ',
 'https://i.imgur.com/pesVKmMh.jpg ',
 'https://i.imgur.com/V3R0cmvh.jpg ',
 'https://i.imgur.com/8zg2suYh.jpg ',
 'https://i.imgur.com/pX0kCEfh.jpg ',
 'https://i.imgur.com/3GdN8qvh.jpg ',
 'https://i.imgur.com/jGyj8hnh.jpg ',
 'https://i.imgur.com/xXfWBuxh.jpg ',
 'https://i.imgur.com/sPqgaqHh.png ',
 'https://i.imgur.com/KQncyTIh.png ',
 'https://i.imgur.com/AR01WlJh.jpg ',
 'https://i.imgur.com/3MmIiwUh.png ',
 'https://i.imgur.com/slhBBPqh.jpg ',
 'https://i.imgur.com/t6u3oxzh.png ',
 'https://i.imgur.com/3nNdcyRh.jpg ',
 'https://i.imgur.com/rkg4eAjh.jpg ',
 'https://i.imgur.com/cHEVMDBh.png ',
 'https://i.imgur.com/N7eMTs7h.jpg ',
 'https://i.imgur.com/ogxU6RRh.png ',
 'https://i.imgur.com/8ngBECJh.jpg ',
 'https://i.imgur.com/o8Vkagfh.jpg ',
 'https://i.imgur.com/wM7Bmgqh.jpg ',
 'https://i.imgur.com/uyIYSKZh.jpg ',
 'https://i.imgur.com/vdYDEobh.jpg ',
 'https://i.imgur.com/QzpCWBfh.jpg ',
 'https://i.imgur.com/5efCFeuh.jpg ',
 'https://i.imgur.com/3hk2vV5h.jpg ',
 'https://i.imgur.com/Rshe6LZh.jpg ',
 'https://i.imgur.com/ksGZsi2h.jpg ',
 'https://i.imgur.com/8BKlC8dh.jpg ',
 'https://i.imgur.com/Xhlrw2ch.jpg ',
 'https://i.imgur.com/nAQkleoh.png ',
 'https://i.imgur.com/ALrM2ZVh.jpg ',
 'https://i.imgur.com/RDHt4gkh.jpg ',
 'https://i.imgur.com/RvhIH9Zh.jpg ',
 'https://i.imgur.com/6QUMPLvh.jpg ',
 'https://i.imgur.com/jeutft7h.jpg ',
 'https://i.imgur.com/CqHFhl2h.jpg ',
 'https://i.imgur.com/BvHTZYzh.jpg ',
 'https://i.imgur.com/fwHR3yLh.jpg ',
 'https://i.imgur.com/YbxXzldh.jpg ',
 'https://i.imgur.com/o2HLl8ih.jpg ',
 'https://i.imgur.com/nUXGmUPh.png ',
 'https://i.imgur.com/lludSoch.png ',
 'https://i.imgur.com/h71BBcwh.jpg ',
 'https://i.imgur.com/PnNSME0h.png ',
 'https://i.imgur.com/oWiVymeh.jpg ',
 'https://i.imgur.com/EqQAgL8h.png ',
 'https://i.imgur.com/CtWcdqbh.jpg ',
 'https://i.imgur.com/rm9fh7Yh.jpg ',
 'https://i.imgur.com/QxFQijNh.jpg ',
 'https://i.imgur.com/cUbY2IWh.jpg ',
 'https://i.imgur.com/vC7pm9rh.jpg ',
 'https://i.imgur.com/cRflWrYh.jpg ',
 'https://i.imgur.com/GwOoWn9h.jpg ',
 'https://i.imgur.com/gODh17vh.jpg ',
 'https://i.imgur.com/FG9KyUQh.jpg ',
 'https://i.imgur.com/fFH1aOVh.jpg ',
 'https://i.imgur.com/MUmP036h.jpg ',
 'https://i.imgur.com/aOuxAbgh.png ',
 'https://i.imgur.com/ucoyWPwh.jpg ',
 'https://i.imgur.com/b05HpLch.png ',
 'https://i.imgur.com/NBbJ1Lfh.jpg ',
 'https://i.imgur.com/Es3df3oh.jpg ',
 'https://i.imgur.com/K3yI4lyh.jpg ',
 'https://i.imgur.com/XKW28VOh.jpg ',
 'https://i.imgur.com/87LcYAAh.jpg ',
 'https://i.imgur.com/xVCXpPVh.jpg ',
 'https://i.imgur.com/lxbiBpah.jpg ',
 'https://i.imgur.com/V95daFph.jpg ',
 'https://i.imgur.com/d2W3sDyh.jpg ',
 'https://i.imgur.com/9E6y9erh.jpg ',
 'https://i.imgur.com/8Vjyqpvh.jpg ',
 'https://i.imgur.com/XUdcjFsh.jpg ',
 'https://i.imgur.com/ww98APSh.jpg ',
 'https://i.imgur.com/WEKVyKnh.jpg ',
 'https://i.imgur.com/o32AxXNh.jpg ',
 'https://i.imgur.com/3fZnCV7h.jpg ',
 'https://i.imgur.com/6oT4ONvh.jpg ',
 'https://i.imgur.com/MQxKPbth.jpg ',
 'https://i.imgur.com/WjPaXjYh.jpg ',
 'https://i.imgur.com/jUZLwEnh.jpg ',
 'https://i.imgur.com/v8ImRoTh.jpg ',
 'https://i.imgur.com/M4qTDFvh.png ',
 'https://i.imgur.com/4rT4mS6h.jpg ',
 'https://i.imgur.com/J06CZzxh.png ',
 'https://i.imgur.com/9Renalth.jpg ',
 'https://i.imgur.com/5zNyTR9h.png ',
 'https://i.imgur.com/8CsG3avh.jpg '
 ];


var linksZerowaste = ['https://i.imgur.com/wzEG0fnh.jpg ',
 'https://i.imgur.com/ldT12DGh.jpg ',
 'https://i.imgur.com/jKVJPgWh.jpg ',
 'https://i.imgur.com/3Ls8Ppjh.jpg ',
 'https://i.imgur.com/KRwnOUVh.jpg ',
 'https://i.imgur.com/L9WpXfCh.jpg ',
 'https://i.imgur.com/I4cW198h.jpg ',
 'https://i.imgur.com/ozwogIqh.jpg ',
 'https://i.imgur.com/ZQaAvPEh.jpg ',
 'https://i.imgur.com/FUcPvh3h.jpg ',
 'https://i.imgur.com/M1lrTPrh.jpg ',
 'https://i.imgur.com/Ec63ChZh.jpg ',
 'https://i.imgur.com/mCsfBtWh.jpg ',
 'https://i.imgur.com/UWNLxwKh.png ',
 'https://i.imgur.com/YUcTkPWh.jpg ',
 'https://i.imgur.com/LKdnpDhh.jpg ',
 'https://i.imgur.com/rdXJr2yh.jpg ',
 'https://i.imgur.com/4OcqGH7h.png ',
 'https://i.imgur.com/6tZtgf9h.jpg ',
 'https://i.imgur.com/ChQKo8rh.jpg ',
 'https://i.imgur.com/QOUjZRQh.jpg ',
 'https://i.imgur.com/aAAYH9gh.jpg ',
 'https://i.imgur.com/AIR4eIQh.jpg ',
 'https://i.imgur.com/YvpyquRh.jpg ',
 'https://i.imgur.com/BGTcKyMh.jpg ',
 'https://i.imgur.com/m1IrcLNh.jpg ',
 'https://i.imgur.com/EP9D08Lh.jpg ',
 'https://i.imgur.com/HlHRbVWh.jpg ',
 'https://i.imgur.com/c3B2sDAh.jpg ',
 'https://i.imgur.com/C4EqrvNh.jpg ',
 'https://i.imgur.com/S1uaKeOh.jpg ',
 'https://i.imgur.com/YAr0Oy4h.jpg ',
 'https://i.imgur.com/xNwGEMzh.jpg ',
 'https://i.imgur.com/Sv9auv7h.jpg ',
 'https://i.imgur.com/xqT7WL2h.jpg ',
 'https://i.imgur.com/DWksaYWh.jpg ',
 'https://i.imgur.com/7TVEfgQh.jpg ',
 'https://i.imgur.com/K8UlQjAh.jpg ',
 'https://i.imgur.com/V9zPYbbh.gif ',
 'https://i.imgur.com/XdfZXr9h.jpg ',
 'https://i.imgur.com/yb0SpJEh.jpg ',
 'https://i.imgur.com/PdUH01vh.jpg ',
 'https://i.imgur.com/YXJJ9M0h.jpg ',
 'https://i.imgur.com/dPCuze5h.jpg ',
 'https://i.imgur.com/QjlyHAbh.jpg ',
 'https://i.imgur.com/ViBoITAh.jpg ',
 'https://i.imgur.com/SyiRo3Mh.jpg ',
 'https://i.imgur.com/Jk5pAUBh.jpg ',
 'https://i.imgur.com/nzhPcXOh.jpg ',
 'https://i.imgur.com/pfGXEpYh.jpg ',
 'https://i.imgur.com/5lkeRYOh.jpg ',
 'https://i.imgur.com/HhaBZzSh.jpg ',
 'https://i.imgur.com/ZKwxy29h.png ',
 'https://i.imgur.com/KwnwNkFh.jpg ',
 'https://i.imgur.com/zRzluPuh.jpg ',
 'https://i.imgur.com/FepuX0Gh.jpg ',
 'https://i.imgur.com/Qn33yrWh.jpg ',
 'https://i.imgur.com/pvHiqg7h.jpg ',
 'https://i.imgur.com/gpgC3uSh.jpg ',
 'https://i.imgur.com/cMTYM0Xh.jpg ',
 'https://i.imgur.com/z2GYs36h.jpg ',
 'https://i.imgur.com/VV7NFwQh.jpg ',
 'https://i.imgur.com/6tiazS2h.jpg ',
 'https://i.imgur.com/MKky5LOh.jpg ',
 'https://i.imgur.com/JCDTymih.jpg ',
 'https://i.imgur.com/8L9kFr9h.jpg ',
 'https://i.imgur.com/VOacrgqh.png ',
 'https://i.imgur.com/8jgKQksh.jpg ',
 'https://i.imgur.com/1yOlrJGh.jpg ',
 'https://i.imgur.com/hACJ15Th.jpg ',
 'https://i.imgur.com/Vh9ZLw7h.jpg ',
 'https://i.imgur.com/haReVl4h.jpg ',
 'https://i.imgur.com/DyjRnuxh.jpg ',
 'https://i.imgur.com/oFS6ufAh.jpg ',
 'https://i.imgur.com/WbtmoYHh.jpg ',
 'https://i.imgur.com/AIoMYv0h.jpg ',
 'https://i.imgur.com/hN3uJCEh.jpg ',
 'https://i.imgur.com/PgvY3yEh.jpg ',
 'https://i.imgur.com/DJi8S41h.jpg ',
 'https://i.imgur.com/9bepsP5h.jpg ',
 'https://i.imgur.com/f8Tneuyh.jpg ',
 'https://i.imgur.com/kaBCMQ7h.jpg ',
 'https://i.imgur.com/REVapE7h.jpg ',
 'https://i.imgur.com/1YrDImeh.jpg ',
 'https://i.imgur.com/UZILEiRh.jpg ',
 'https://i.imgur.com/ObagwtPh.jpg ',
 'https://i.imgur.com/nVnhimuh.jpg ',
 'https://i.imgur.com/z3QPxUgh.jpg ',
 'https://i.imgur.com/94vgjhCh.jpg ',
 'https://i.imgur.com/tmOk03Nh.jpg ',
 'https://i.imgur.com/CMCwrywh.jpg ',
 'https://i.imgur.com/eC1tUT2h.jpg ',
 'https://i.imgur.com/FIyhlI5h.jpg ',
 'https://i.imgur.com/O1JdCMTh.jpg ',
 'https://i.imgur.com/jGbCzceh.jpg ',
 'https://i.imgur.com/wyCjwSuh.jpg ',
 'https://i.imgur.com/R1sXYi9h.png ',
 'https://i.imgur.com/HHJH4DAh.jpg ',
 'https://i.imgur.com/vPSDKudh.jpg ',
];

var linksSignage = ['https://i.imgur.com/hAQYGunh.png ',
 'https://i.imgur.com/k6ILqJ4h.png ',
 'https://i.imgur.com/bRB7k12h.png ',
 'https://i.imgur.com/MG71pFGh.png ',
 'https://i.imgur.com/nSWgLP4h.png ',
 'https://i.imgur.com/nSWgLP4h.png ',

];

var size = 1800;
var sz2 = size / 2;

var frameCount = 0;
var displayCount = 51;

var cam;
var yOffset = -600;

var voice;

var memesAntofu = [];
var randIndexAntofu = [];
var antofuLocation = [4 * size, yOffset, 0];

var memesClimatememes = [];
var randIndexClimatememes = [];
var climatememesLocatoin = [2 * size, yOffset, 0];

var memesSustainability = [];
var randIndexSustainability = [];
var sustainabilityLoacation = [0, yOffset, 0];

var memesZerowaste = [];
var randIndexZerowaste = [];
var zerowasteLocation = [-2 * size, yOffset, 0];

var imagesSignage = [];

var texCount = 0;


var testArray = [];




function preload () {

    //load images for each space
    for (i = 0; i < linksAntofu.length; i++) {
        var newMeme = loadImage(linksAntofu[i]);
        memesAntofu.push(newMeme);
    }
    for (i = 0; i < linksClimatememes.length; i++) {
        var newMeme = loadImage(linksClimatememes[i]);
        memesClimatememes.push(newMeme);
    }
    for (i = 0; i < linksSustainability.length; i++) {
        var newMeme = loadImage(linksSustainability[i]);
        memesSustainability.push(newMeme);
    }
    for (i = 0; i < linksZerowaste.length; i++) {
        var newMeme = loadImage(linksZerowaste[i]);
        memesZerowaste.push(newMeme);
    }
    for (i = 0; i < linksSignage.length; i++) {
        var newSign = loadImage(linksSignage[i]);
        imagesSignage.push(newSign);
    }
    

}


function setup() {
    createCanvas(1000, 700, WEBGL);
    cam = createCamera();

    //creates arrays of raondom index values for each space
    for (i = 0; i < displayCount; i++) {
            var newIndex1 = round(random(0, memesSustainability.length)); 
            randIndexSustainability.push(newIndex1);

            var newIndex2 = round(random(0, memesClimatememes.length)); 
            randIndexClimatememes.push(newIndex2);

            var newIndex3 = round(random(0, memesAntofu.length));
            randIndexAntofu.push(newIndex3);

            var newIndex4 = round(random(0, memesZerowaste.length));
            randIndexZerowaste.push(newIndex4);
    }
    

    
}

function boxGrid(w, d, tex, randIndex) {
    //divides left and right walls into grid of boxes w/ opening for door
    var indexCount = 0;
    push();
    for (var ix = 0; ix < 2; ix ++){
        push();
        for (var iy = 0; iy < 9; iy ++){
            translate(0, 0, size / 4.5);
            if (indexCount == 13) {
                noFill();
            }
            else {
                texture(tex[randIndex[texCount]]);
                box(w, size /2, d);
            }
            texCount ++
            indexCount ++
        }
        pop();
        translate(0, size / 2, 0);
    }
    pop();

}


function subSpace (tex, randIndex, x, y, z) {
    //creates the geometry for each space
    push();
    translate(x, y, z);
    texCount = 0;

    noStroke();

    //floor
    texture(tex[randIndex[texCount]]);
    push();
    translate(0, sz2, sz2);
    box(size, 20, 2 * size);
    texCount ++
    pop();

    //back wall
    texture(tex[randIndex[texCount]]);
    push();
    translate(0, 0, 3 * sz2);
    box(-size, size, -20);
    texCount++
    texture(tex[randIndex[texCount]]);
    translate(0, -size, 0);
    box(size, size, 20);
    texCount++
    pop();

    //front wall
    texture(tex[randIndex[texCount]]);
    push();
    translate(0, 0, -sz2);
    box(size, size, 20);
    texCount++
    texture(tex[randIndex[texCount]]);
    translate(0, -size, 0);
    box(size, size, 20);
    texCount++
    pop();

    //right wall
    push();
    translate(sz2, -sz2 + (size / 4), -sz2 - (size / 9));
    boxGrid(20, size / 4.5, tex, randIndex);
    texCount++
    pop();

    //left wall
    push();
    translate(-sz2, -sz2 + (size / 4), -sz2 - (size / 9));
    boxGrid(-20, -size / 4.5, tex, randIndex);
    pop();

    //roof
    push();
    translate(-sz2 + size / 10, -sz2 - size/10, sz2);
    for (i = 0; i < 7; i++) {
        box(size/5, size/5, 2 * size);
        texture(tex[randIndex[texCount]]);
        if (i <= 1) {
            translate(size/5, -size/5, 0);            
        }
        else {
            translate(size/5, size/5, 0);    
        }
        texCount++
    }
    pop();



    pop();

}

function hallSpace(sign, x, y, z) {
    //creates geometry for the halls and associated signage
    var wHall = size / 4.5;
    var lHall = size;
    var hHall = size / 3;
    var wHall2 = wHall / 2;
    var lHall2 = lHall / 2;
    var hHall2 = hHall / 2;

    push();
    translate(x, y + hHall, z);
    fill(255);
    noStroke();

    //ceiling
    push();
    translate(0, -hHall2 - 9, 0);
    box(lHall + 16, 20, wHall);
    pop();
    
    //floor
    push();
    translate(0, hHall2 + 9, 0);
    box(lHall + 16, -20, wHall);
    pop();

    //front wall
    push();
    translate(0, 0, -wHall2 - 9);
    box(lHall + 16, hHall, -20);
    pop();

    //back wall
    push();
    translate(0, 0, wHall2 + 9);
    box(lHall + 16, hHall, 20);
    pop();

    //signage 1
    push();
    translate(lHall2 + 10, - hHall2 - size / 12, 0);
    -texture(imagesSignage[sign]);
    box(-10, size / 6, -size / 4.5);

    pop();

    //signage 2
    push();
    translate(-lHall2 - 10, -hHall2 - size / 12, 0);
    texture(imagesSignage[sign + 1]);
    box(10, size / 6, size / 4.5);
    pop();

    pop();

}


function moveFunction () {
    //allows camera to be moved with keyboard

    boundaryFunction();
    var dx = 8;
    var dz = 8;

    var px = 0.02;
    var py = 0.02;

    //move left
    if (keyIsDown(65)) {
        cam.move(-dx, 0, 0);
    }
    //move right
    if (keyIsDown(68)) {
        cam.move(dx, 0, 0);
    }
    //move back
    if (keyIsDown(83)) {
        cam.move(0, 0, dz);
    }
    //move forward
    if (keyIsDown(87)) {
        cam.move(0, 0, -dz);
    }
    
    //camera rotate left
    if (keyIsDown(LEFT_ARROW)) {
        cam.pan(px);
    }
    //camera rotate right
    if (keyIsDown(RIGHT_ARROW)) {
        cam.pan(-px);
    }
    //camera rotate down
    if (keyIsDown(DOWN_ARROW)) {
        cam.tilt(py);
    }
    //camera rotate up
    if (keyIsDown(UP_ARROW)) {
        cam.tilt(-py);
    }
    //maintains camera at the same height allways
    cam.eyeY = 0;
}

function boundaryFunction() {
    //stops user form passing through walls
    if (cam.eyeX > -5 * sz2 & cam.eyeX < -3 * sz2) {
        if (cam.eyeZ < - 0.8 * sz2) {
            cam.eyeZ = - 0.8 * sz2
        }
        if (cam.eyeZ > 2.8 * sz2) {
            cam.eyeZ = 2.8 * sz2;
        }
        if (cam.eyeZ < (sz2 - size / 9) || cam.eyeZ > (sz2 + size / 9)) {
            if (cam.eyeX < -4.8 * sz2) {
                cam.eyeX = -4.8 * sz2;

            }
            if (cam.eyeX > -3.2 * sz2) {
                cam.eyeX = -3.2 * sz2;
            }
        }
    }
    else if (cam.eyeX > -sz2 & cam.eyeX < sz2) {
        if (cam.eyeZ < - 0.8 * sz2) {
            cam.eyeZ = - 0.8 * sz2
        }
        if (cam.eyeZ > 2.8 * sz2) {
            cam.eyeZ = 2.8 * sz2;
        }
        if (cam.eyeZ < (sz2 - size / 9) || cam.eyeZ > (sz2 + size / 9)) {
            if (cam.eyeX < -0.8 * sz2) {
                cam.eyeX = -0.8 * sz2;

            }
            if (cam.eyeX > 0.8 * sz2) {
                cam.eyeX = 0.8 * sz2;
            }
        }
        
    }
    else if (cam.eyeX > 3 * sz2 & cam.eyeX < 5 *sz2) {
        if (cam.eyeZ < - 0.8 * sz2) {
            cam.eyeZ = - 0.8 * sz2
        }
        if (cam.eyeZ > 2.8 * sz2) {
            cam.eyeZ = 2.8 * sz2;
        }
        if (cam.eyeZ < (sz2 - size / 9) || cam.eyeZ > (sz2 + size / 9)) {
            if (cam.eyeX < 3.2 * sz2) {
                cam.eyeX = 3.2 * sz2;

            }
            if (cam.eyeX > 4.8 * sz2) {
                cam.eyeX = 4.8 * sz2;
            }
        }

    }
    else if (cam.eyeX > 7 * sz2 & cam.eyeX < 9 *sz2) {
        if (cam.eyeZ < - 0.8 * sz2) {
            cam.eyeZ = - 0.8 * sz2
        }
        if (cam.eyeZ > 2.8 * sz2) {
            cam.eyeZ = 2.8 * sz2;
        }
        if (cam.eyeZ < (sz2 - size / 9) || cam.eyeZ > (sz2 + size / 9)) {
            if (cam.eyeX < 7.2 * sz2) {
                cam.eyeX = 7.2 * sz2;

            }
            if (cam.eyeX > 8.8 * sz2) {
                cam.eyeX = 8.8 * sz2;
            }
        }

    }
    else {
        if (cam.eyeZ < (sz2 + 60 - size / 9)) {
            cam.eyeZ = (sz2 + 60 - size / 9)
        }
        if (cam.eyeZ > (sz2 - 60 + size / 9)){
            cam.eyeZ = (sz2 - 60 + size / 9);
        }
        if (cam.eyeX < - 6.5 * sz2) {
            cam.eyeX = - 6.5 * sz2;
        }
        if (cam.eyeX >  10.5 * sz2) {
            cam.eyeX =  10.5 * sz2;
        }

    }


}

function frameCounter() {
    //generates new random array of indexes to display new imagery every 450 frames
    frameCount++

    if (frameCount % 450 == 0) {
        for (i = 0; i < displayCount; i++) {
            var newIndex1 = round(random(0, memesSustainability.length)); 
            randIndexSustainability.shift();
            randIndexSustainability.push(newIndex1);

            var newIndex2 = round(random(0, memesClimatememes.length)); 
            randIndexClimatememes.shift();
            randIndexClimatememes.push(newIndex2);

            var newIndex3 = round(random(0, memesAntofu.length)); 
            randIndexAntofu.shift();
            randIndexAntofu.push(newIndex3);

            var newIndex4 = round(random(0, memesZerowaste.length)); 
            randIndexZerowaste.shift();
            randIndexZerowaste.push(newIndex4);

        }
    }
}

function draw() {
    background(190, 220, 255);
    //draw spaces
    hallSpace(4, -3 * size, yOffset, size / 2);
    subSpace(memesZerowaste, randIndexZerowaste, zerowasteLocation[0], zerowasteLocation[1], zerowasteLocation[2]);
    hallSpace(0, -size, yOffset, size / 2);
    subSpace(memesSustainability, randIndexSustainability, sustainabilityLoacation[0], sustainabilityLoacation[1], sustainabilityLoacation[2]);
    hallSpace(1, size, yOffset, size / 2);
    subSpace(memesClimatememes, randIndexClimatememes, climatememesLocatoin[0], climatememesLocatoin[1], climatememesLocatoin[2]);
    hallSpace(2, 3 * size, yOffset, size / 2);
    subSpace(memesAntofu, randIndexAntofu, antofuLocation[0], antofuLocation[1], antofuLocation[2]);
    hallSpace(4, 5 * size, yOffset, size / 2);

    //allows movement
    moveFunction();
    //generates new random index arrays
    frameCounter(); 
}

With my project I attempted to create a spatial-visual representation of different online discourses and imagery surrounding climate change. I used four sets of images scraped from four different subreddits relating to climate change r/ZeroWaste r/Sustainability, r/ClimateMemes, and r/Antofu. These subreddits all have different ideological tendencies that inform people’s discussions of climate change. If I had more time for this project I would have liked to incorporate some of the individual character of the subreddits into the geometry of the spaces and I would have liked to add some minimal contextualizing text that displays as an overlay when moving from one subredddit space to another in order to add some of my own opinions to frame the experience of each space.

To move through the space use WASD
To rotate the camera use the Arowkeys

Final Project: Air Pollution Simulator

sketch
var plastic = ["https://i.imgur.com/n3n2yAx.png", 
                "https://i.imgur.com/GO1fho6.png",
                "https://i.imgur.com/HTF7LVN.png",
                "https://i.imgur.com/lPCz5Kl.png",
                "https://i.imgur.com/uOAHfcT.png",
                "https://i.imgur.com/714d3E7.png",
                "https://i.imgur.com/mxW1JT4.png",
                "https://i.imgur.com/2diHO2t.png",
                "https://i.imgur.com/YfCSzcQ.png",
                "https://i.imgur.com/TZovsxa.png",
                "https://i.imgur.com/lK07FmR.png"];
var waste1;
var waste2;
var waste3;
var waste4;
var waste5;
var waste6;
var waste7;
var waste8;
var waste9;
var waste10;
var waste11;

var humanfiles = [];
var human = [];
var vehiclefiles = [];
var vehicles = [];
var wheel;
var instruction;

var newBackground = [];
var newCharacter = [];

var c1,c2;
var mode = false;
var instructionMode = true;

function preload() {
    //waste images
    waste1 = loadImage(plastic[0]);
    waste2 = loadImage(plastic[1]);
    waste3 = loadImage(plastic[2]);
    waste4 = loadImage(plastic[3]);
    waste5 = loadImage(plastic[4]);
    waste6 = loadImage(plastic[5]);
    waste7 = loadImage(plastic[6]);
    waste8 = loadImage(plastic[7]);
    waste9 = loadImage(plastic[8]);
    waste10 = loadImage(plastic[9]);
    waste11 = loadImage(plastic[10]);

    //characters
    humanfiles[0] = "https://i.imgur.com/gGl600Z.png";
    humanfiles[1] = "https://i.imgur.com/6yqtw3q.png";

    for (var i = 0; i < humanfiles.length; i++) {
        human[i] = loadImage(humanfiles[i]);
    }

    //vehicle
    vehiclefiles[0] = "https://i.imgur.com/gnO3lJm.png";
    vehiclefiles[1] = "https://i.imgur.com/S1GOMdC.png";

    for (var i = 0; i < vehiclefiles.length; i++) {
        vehicles[i] = loadImage(vehiclefiles[i]);
    }
    wheel= loadImage("https://i.imgur.com/Wkpp7B1.png");
    instruction = loadImage("https://i.imgur.com/QcOMxYC.png");
}
//Factory made of waste
function generateBackground(bx, bdx) {
    var b = {
        x: bx, 
        y:height-75,
        dx: bdx,
        items: random([waste1, waste2, waste3, waste4, waste5, waste6, waste7, waste8, waste9, waste10, waste11]),
        moveFunction: moveBackground,
        drawFunction: drawBackground
    }
    return b;

}

function moveBackground() { //generative landscape
    if (keyIsDown(RIGHT_ARROW)) {
        this.x -= this.dx; 
               
    } else if (keyIsDown(LEFT_ARROW)) {
        this.x += this.dx;
    }
    
}


function drawBackground() {
    var smallSize = 20;
    var bigSize = 30
    push();
    if (this.items == waste1) {
        image(waste1, this.x, 325-waste1.height);
    } else if (this.items == waste2) {
        image(waste2, this.x, 325-waste2.height);
    } else if (this.items == waste3) {
        image(waste3, this.x, 325-waste3.height);
    } else if (this.items == waste4) {
        image(waste4, this.x, 325-waste4.height);
    } else if (this.items == waste5) {
        image(waste5, this.x, 325-waste5.height);
    } else if (this.items == waste6) {
        image(waste6, this.x, 325-waste6.height);
    } else if (this.items == waste7) {
        image(waste7, this.x, 325-waste7.height);
    } else if (this.items == waste8) {
        image(waste8, this.x, 325-waste8.height);
    } else if (this.items == waste9) {
        image(waste9, this.x, 325-waste9.height);
    } else if (this.items == waste10) {
        image(waste10, this.x, 325-waste10.height);
    } else if (this.items == waste11) {
        image(waste11, this.x, 325-waste11.height);
    }

    pop();
    

}

function itemShow() {
    for(var i = 0; i < 100; i++) {
        newBackground[i].moveFunction();
        newBackground[i].drawFunction();
    }
}

//Character skating
function makeSkateCharacter (cx, cdx) {
    var c = {
        x: cx,
        dx: cdx,
        y: height-150,
        movingRight: true,
        stepSkateFunction: stepSkateCharacter,
        drawSkateFunction: drawSkateCharacter
    }
    return c;
}

function stepSkateCharacter () {
    if (keyIsDown(RIGHT_ARROW)) {
        this.movingRight = true;
        if (this.x < width/2) {
            this.x += this.dx;
        } 
    }
}

function drawSkateCharacter () {
    image(vehicles[0], this.x-25, height-80, 70, 25);
    image(human[0], this.x, this.y);

    
}

//Character riding bike
function makeBikeCharacter (mx, wmx, mdx) {
    var m = {
        x: mx,
        wx: wmx,
        dx: mdx,
        y: height-150,
        movingRight: true,
        stepBikeFunction: stepBikeCharacter,
        drawBikeFunction: drawBikeCharacter,
    }
    return m;

}


function stepBikeCharacter () {
    if (keyIsDown(RIGHT_ARROW)) {
        this.movingRight = true;
        push(); //bike wheel rotating
        imageMode(CENTER);
        translate(this.wx+18, this.y+73);
        r+=0.5;
        rotate(r);
        image(wheel, 0, 0, 35, 35);
        pop();
        push();
        imageMode(CENTER);
        translate(this.wx+103, this.y+73);
        r+=1;
        rotate(r);
        image(wheel, 0, 0, 35, 35);
        pop();

        if (this.x < width/2) {
            this.x += this.dx;
        } 

    }

}
var r = 0;

function drawBikeCharacter () {
    if (this.movingRight == true) {
        image(vehicles[1], this.x-40, height-120, 120, 60);
        image(human[1], this.x, this.y);
        
        
    } else {
        push();
        translate(600, 0);
        scale(-1, 1);
        image(vehicles[1], this.x-25, height-80, 200, 100);
        image(human[1], this.x, this.y);
        pop();

    }

}




function setup() {
    createCanvas(600, 400);
    frameRate(15);
    var n = 0;
    for (var i = 0; i < 100; i++) {
        var x = generateBackground(n, 5);
        newBackground.push(x);
        if (newBackground[i].items == waste1) { //placement of each waste factory
            n += waste1.width-2;
        } else if (newBackground[i].items == waste2) {
            n += waste2.width-2;
        } else if (newBackground[i].items == waste3) {
            n += waste3.width-2;
        } else if (newBackground[i].items == waste4) {
            n += waste4.width-2;
        } else if (newBackground[i].items == waste5) {
            n += waste5.width-2;
        } else if (newBackground[i].items == waste6) {
            n += waste6.width-2;
        } else if (newBackground[i].items == waste7) {
            n += waste7.width-2;
        } else if (newBackground[i].items == waste8) {
            n += waste8.width-2;
        } else if (newBackground[i].items == waste9) {
            n += waste9.width-2;
        } else if (newBackground[i].items == waste10) {
            n += waste10.width-2;
        } else if (newBackground[i].items == waste11) {
            n += waste11.width-2;
        }
    }

    var d = makeSkateCharacter(width/2, 3);
    var e = makeBikeCharacter(width/2, width/2-40, 5);

    newCharacter.push(d);
    newCharacter.push(e);
   

}

function draw() {
    var cAmount = 100;
    
    c1 = color(80);
    //gradient color change & fleeting effect on the factory in sustainable future
    c1.setAlpha(10 + 10 * sin(millis() / 1000)); 
    c2 = color(230);
    c4 = color(225,247,255);
    c3 = color(0, 171, 245);
    c3.setAlpha(10 + 10 * sin(millis() / 1000));

    var year = 2050;
    var title = "WHICH FUTURE DO YOU CHOOSE TO LIVE IN?";
  
        
    
    noStroke();
    if (mode) {        
         for(let y=0; y<height; y++){ //gradient background
            n = map(y,0,height,0,1);
            let newc = lerpColor(c3,c4,n);
            stroke(newc);
            line(0,y,width, y);
        }
        fill(255);
        textSize(270);
        text(year, width/2, height-82);
        textSize(25);
        textAlign(CENTER);
        text(title, width/2, height-300);
        itemShow();
        fill(100);
        noStroke();
        rect(0, height-76, width, 76);
        newCharacter[0].stepSkateFunction();
        newCharacter[0].drawSkateFunction();
    } else {
        background(0);
        for(let y=0; y<height; y++){
            n = map(y,0,height,0,1);
            let newc = lerpColor(c1,c2,n);
            stroke(newc);
            line(0,y,width, y);
        }
        fill(255);
        textSize(270);
        text(year, width/2, height-82);
        textSize(25);
        textAlign(CENTER);
        text(title, width/2, height-300);
        itemShow();
        fill(100);
        noStroke();
        rect(0, height-76, width, 76);
        newCharacter[1].drawBikeFunction();
        newCharacter[1].stepBikeFunction();

    }

    if (instructionMode) {
        push();
        imageMode(CENTER);
        image(instruction, width/2, height/2);
        pop();    }

    if (keyIsDown(81)) { //show instruction page
        push();
        imageMode(CENTER);
        image(instruction, width/2, height/2);
        pop();
     } 
    
    
}

//toggle between bike and skate
function keyPressed() {
    if (key == ' ') {
        if (mode == false) {
            mode = true;
        } else if (mode == true) {
            mode = false;
        }
    } 

}

function mousePressed() {
    if (instructionMode == true){
        instructionMode = false;
    }

}














When I heard that the topic for this project is climate change, I was instantly reminded of previous poster work on air pollution, in which I used everyday waste material to draw factories as a metaphor.

This program is a future simulator that shows two alternative versions of 2050’s air quality based how sustainable our lifestyle is. I wanted to continue this use of symbols, so I decided to create a character that interacts with this environment by creating a character that rides a vehicle that is also a metaphor for wasteful lifestyle and a sustainable one. The user of this program can toggle between a character that rides a skateboard made out of a reusable water bottle and a character that rides a motorcycle made of waste like aluminum can wheels. As the user presses down the right arrow key, they can see that the character is moving in the generative landscape. As they toggle the space bar, they can change the vehicle, and see how the air quality changes depending on how much single use products we use. In the sustainable future factories made out of trash starts to wither away, in contrast to how static they are in the polluted version. The main goal of this program is to alert people of the drastic difference our everyday behavior can make to our environment and future and provoke action.in goal of this program is to alert people of the drastic difference our everyday behavior can make to our environment and future and provoke action.

Final Project

sketch
// WARNING: FOR SOME REASON THE PROGRAM IS VERY LAGGY ON CHROME. HOWEVER, WORKS VERY SMOOTHLY WITH SAFARI.

var trash=["https://i.imgur.com/4OExNH5.png", "https://i.imgur.com/mNxZdnx.png", "https://i.imgur.com/2utBIl1.png", "https://i.imgur.com/onA6aUl.png"];
var recyclebin=["https://i.imgur.com/p6HfTlh.png"];
var canfact=['https://i.imgur.com/PUJEJM4.png'];
var milkfact=['https://i.imgur.com/C5jKZj9.png'];
var waterfact =['https://i.imgur.com/VcUrBbs.png'];
var winefact =['https://i.imgur.com/pWmodnq.png'];
var background =['https://i.imgur.com/Mz0ml4E.png'];

var trash1;
var trash2; 
var trash3;
var trash4;
var speed= 7;

var place=[];
var ntrash=200;
var x=0;
var speed=7;

function preload() {
    trash1=loadImage(trash[0]); // wine
    trash2=loadImage(trash[1]); // water
    trash3=loadImage(trash[2]); // milk 
    trash4=loadImage(trash[3]); // can
    recyclebin = loadImage('https://i.imgur.com/p6HfTlh.png');
    background = loadImage('https://i.imgur.com/Mz0ml4E.png')

    winefact = loadImage('https://i.imgur.com/pWmodnq.png');
    waterfact = loadImage('https://i.imgur.com/VcUrBbs.png');
    milkfact = loadImage('https://i.imgur.com/C5jKZj9.png');
    canfact = loadImage('https://i.imgur.com/PUJEJM4.png');
}

function setup() {
    createCanvas(800, 500);
    var n = 0;
    for (var i = 0; i < 1000; i++){ //
        place[i] = makePlace(n);
        n -= 200;
    }
    frameRate(30);
}

function draw() {
    image(background,0,0);
    placeShow(); 
    image(recyclebin, mouseX, mouseY);

    if (mouseIsPressed & mouseX<400 && mouseY<250) {
        image(winefact, 0, 0);
    } 

    if (mouseIsPressed & mouseX>400 && mouseY<250) {
        image(waterfact,0,0);
    }

    if (mouseIsPressed & mouseX<400 && mouseY>240) {
        image(milkfact,0,0);
    }

    if (mouseIsPressed & mouseX>400 && mouseY>250) {
        image(canfact,0,0);
    }
}

function placeGo(){
    this.x+=this.dx;
}
function placeShow(){
    for(var i = 0; i < place.length; i++){
        place[i].go();
        place[i].show();
        // plate[i].mP();
    }
}

function makePlace(px){
    var place={x: px, y:1, w:1, h:1,
    dx: 7, go:placeGo, show:drawPlace,
    trash: random([trash1, trash2, trash3, trash4]),
    }
    return place;
}

function drawPlace(){
    push();
    fill(0);
    noStroke();
    ellipse(this.x, this.y, this.w, this.h);
    stroke(185);
    noFill();
    ellipse(this.x, this.y, 0.75*this.w, 0.75*this.h);
    if (this.trash==trash1){
            image(trash1, this.x-50, 0);
        }
    if (this.trash==trash2){
        image(trash2, this.x-50, 0);
         }
    if (this.trash==trash3){
        image(trash3, this.x-50, 0);
         }
    if (this.trash==trash4){
        image(trash4, this.x-50, 0);
         } 

function keyPressed() {
  clear();
    }
}

For my final project I decided to narrow in specifically of human consumption waste and recycling. The program is a conveyer belt of a recycling incinerator, the images are all hand drawn through illustrator and procreate. It is simple to run, when you click the screen different facts about the 4 different products will show up: cardboard, glass, plastic, and metal. I also included the mouse to be a recycling bin to add as context clues to what is happening. The art style I was inspired by is my color palette for my animations I do for design. If I had more time I would make buttons which correlate to the random recyclable material functions and have each fact correlate. I would also make a larger frame to show the recycling process and make it much larger than just one simple conveyer belt.
Please Note:
The program works very smoothly with safari but is very laggy on chrome. (I already checked in with a TA about this)

Final Project: Ocean Clean-up Simulator

sketch
//Anthony Pan
//Section C
//final project proposal final

//requirements:
    //loops, arrays, conditionals (if), user interaction, transformations, 
    //functions (besides setup and draw), 
    //and use of at least one object definition of your own design.

//net object "line" "pushes" trash objects to the right of the canvas 
    // if trash objects are to the right of the line, update all of the ones to the right 
    //within certain number of pixels, x position of the trash objects will update and increase incrementally
    //lin search particle loop
    //if statement with mouseX
        //capture value of mouseX at that instance to avoid bugs
//create seperate function that changes background color
// use series of if statements

//array and object for garbage 1
var garbage1Showing = [];
var garbage1; 

//array and object for garbage 2
var garbage2; 
var garbage2Showing = [];


//array and object for ocean details
var OceanDetail; 
var oceanDetailShowing = [];

//frame counter
var counter = 0;

var fishes = [];
var fish;  

//angle for rotation og garbage2 object
var angle = 0;

function setup() {
    createCanvas(500, 200);

    //create objects for garbage 1
    for(var i = 0; i < 8; i ++) {
        garbage1 = makeGarbage1(random(50,150), color(random(255)));
        garbage1Showing.push(garbage1);

    }

    //create objects for garbage 2
    for(var i = 0; i < 10; i++) {
        garbage2 = makeGarbage2(random(60, 140));
        garbage2Showing.push(garbage2);
    }

    //create objects for ocean details
    for(var i = 0; i < 7; i++) {
        OceanDetail = makeOceanDetail(random(0,height), color(255));
        oceanDetailShowing.push(OceanDetail);
    }

    
    for (var i = 0; i < 10; i++) {
        fish = makeFish();
        fishes.push(fish);
    }
    

    
}

function draw() {
    //change water color based on # of objects in water
    waterChange();



    //ocean detail functions
    OceanDetailDisplay();
    removeOceanDetail();
    addNewOceanDetail();

    noStroke();
    
    //garbage2 functions
    garbage2DisplayandMove();
    removeGarbage2();

    //garbage1 functions
    garbage1DisplayandMove();
    removeGarbage1();

    //add new garbage to ocean based on probability
    addNewGarbage1();
    addNewGarbage2();

    //display fish if water is blue to dark blue
    if(garbage1Showing.length > 0 & garbage1Showing.length <= 40) {
        displayFish();
    }
    

    //draw net
    fill(255);
    noStroke();
    rect(mouseX, 0, 2, 400);

    //check if garbage is ahead of net, if so use net to push them off screen 
    checkGarbage1Ahead();
    checkGarbage2Ahead();
    

}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//fish code

//fish constructor
function makeFish() {
    var fish = {x: random(25, 600), y: random(25, 220),
        speed: random(-0.2,0.2),
        c: color(10,10,random(255)),
        draw: drawFish,
        move: moveFish
    }
    return fish;
}

//draw fish shape
function drawFish() {
    fill(this.c);
    push();
    scale(0.8); //transformation 
    ellipse(this.x, this.y, 20, 10);

    //direction of fish indicates which way tail is facing
    if(this.speed < 0) {
        triangle(this.x+10, this.y, this.x+15, this.y-5, this.x+15, this.y+5);
    } else {
        triangle(this.x-10, this.y, this.x-15, this.y-5, this.x-15, this.y+5);
    }
    pop();

}

//move fish 
function moveFish() {
    this.x += this.speed;

    //hits random point within canvas, fish will turn other direction 
    if(this.x > width - random(50) || this.x < random(50)) {
        this.speed = -this.speed; 
    }
}

//one function to display and move fish on canvas 
function displayFish() {
    for(var i = 0; i < fishes.length; i++) {
        fishes[i].move();
        fishes[i].draw();
    }
}




////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//type garbage1 functions

//garbage1 constructor
function makeGarbage1(gy, c) {
    var garbage1 = {x: -10, y: gy,
        speed: random(0.05,0.75),
        Yspeed: random(0,0.2),
        size: random(1,6),
        fill: c,
        move: garbage1Move,
        draw: garbage1Draw }
    return garbage1;
}

//draw garbage1
function garbage1Draw() {
    fill(this.fill);
    ellipse(this.x, this.y, this.size, this.size);


}

//move garbage1
function garbage1Move() {
    this.x += this.speed;
    this.y += this.Yspeed;
    if(this.y >= 150 || this.y <= 50) {
        this.Yspeed = -this.Yspeed;
    }

    //to slow down at the middle and collect
    if(this.x >= width/2) {
        this.speed = 0.001;

    }

}

//1 function to move and draw garbage
function garbage1DisplayandMove() {
    for(var i = 0; i < garbage1Showing.length; i++) {
        garbage1Showing[i].move();
        garbage1Showing[i].draw();
    }

}

//make new garbage based on probability 
function addNewGarbage1() {
    var newGarbage1likelihood = 0.01;
    if(random(0,1) < newGarbage1likelihood) {
         garbage1Showing.push(makeGarbage1(random(50,150), color(random(255))));
    }
}

//remove garbage off screen 
function removeGarbage1() {
    var garbage1ToKeep = [];
    for (var i = 0; i < garbage1Showing.length; i++){
        if (garbage1Showing[i].x < width) {
            garbage1ToKeep.push(garbage1Showing[i]);
        }
    }
    garbage1Showing = garbage1ToKeep; // remember the showing garbage2
}



////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//garbage2 functions

//garbage 2 constructor
function makeGarbage2(gy) {
    var garbage2 = {x: -10, y: gy,
        speed: random(0.1,0.3),
        Yspeed: random(0,0.2),
        size: random(2,7),
        r: random(255),
        g: random(255),
        b: random(255),
        move: garbage2Move,
        draw: garbage2Draw }
    return garbage2;

}

//draw garbage 2 
function garbage2Draw() {
    rectMode(CENTER);

    //garbage spins
    push();
    translate(this.x,this.y);
    rotate(radians(angle));
    angle += 0.1;

    fill(this.r, this.g, this.b);
    rect(0, 0, this.size, this.size);

    pop();
}

//move garbage 2
function garbage2Move() {
    this.x += this.speed;
    this.y += this.Yspeed;
    if(this.y >= 140 || this.y <= 60) {
        this.Yspeed = -this.Yspeed;
    }

    //to slow down at the middle and collect
    if(this.x >= width/2) {
        this.speed = 0.001;

    }

}

//1 function to draw and move garbage
function garbage2DisplayandMove() {
    for(var i = 0; i < garbage2Showing.length; i++) {
        garbage2Showing[i].move();
        garbage2Showing[i].draw();
    }

}

//remove garbage 2 if off screen 
function removeGarbage2() {
    var garbage2ToKeep = [];
    for (var i = 0; i < garbage2Showing.length; i++){
        if (garbage2Showing[i].x < width) {
            garbage2ToKeep.push(garbage2Showing[i]);
        }
    }
    garbage2Showing = garbage2ToKeep; // remember the showing garbage2
}

//add new garbage periodically
function addNewGarbage2() {
    var newGarbage2likelihood = 0.01;
    if(random(0,1) < newGarbage2likelihood) {
         garbage2Showing.push(makeGarbage2(random(50,150)));
    }
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//make ocean details

//make ocean detail object
function makeOceanDetail(oy, c) {
    OceanDetail = {x: 0, y: oy,
        speed: random(0.1,0.3),
        fill: c,
        move: oceanDetailMove,
        draw: oceanDetailDraw }
    return OceanDetail;
}

//move ocean detail
function oceanDetailMove() {
    this.x += this.speed;
}

//drawocean details
function oceanDetailDraw() {
    noFill();
    strokeWeight(0.2);
    stroke(this.fill);
    curve(this.x, this.y, this.x + 10, this.y - 10, this.x + 10, this.y - 20, this.x, this.y - 30);

}

//1 function to draw and move ocean details
function OceanDetailDisplay() {
    for(var i = 0; i < oceanDetailShowing.length; i++) {
        oceanDetailShowing[i].move();
        oceanDetailShowing[i].draw();
    }

}

//remove ocean details if off screen
function removeOceanDetail() {
    var oceansToKeep = [];
    for (var i = 0; i < oceanDetailShowing.length; i++){
        if (oceanDetailShowing[i].x < width) {
            oceansToKeep.push(oceanDetailShowing[i]);
        }
    }
    oceanDetailShowing = oceansToKeep; // remember the showing ocean details
}

//add new ocean details periodically
function addNewOceanDetail() {
    counter +=1;
    if (counter % 100 == 0){
        oceanDetailShowing.push(makeOceanDetail(random(40,height-40), color(255)));
    }

}





////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//change background color based on number of garbage objects on the screen 

//make this change more gradual 
function waterChange() {
    if(garbage1Showing.length <= 20) {
        background(20,100,255);
    }

    if(garbage1Showing.length > 20 & garbage1Showing.length <= 40) {
        background(51, 89, 163);
    }

    if(garbage1Showing.length > 40 & garbage1Showing.length <= 60) {
        background(59, 81,125);
    }

    if(garbage1Showing.length > 60 & garbage1Showing.length <= 100) {
        background(59, 117,125);
    }

    if(garbage1Showing.length > 100 & garbage1Showing.length <= 120) {
        background(59, 125, 90);
    }

    if(garbage1Showing.length > 120 & garbage1Showing.length <= 140) {
        background(56, 74, 43);
    }

    if(garbage1Showing.length > 140 & garbage1Showing.length <= 160) {
        background(43, 54, 36);
    }

    if(garbage1Showing.length >= 160) {
        background(69, 57, 42);
    }

}




////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//functions that check if particles are ahead of net

function checkGarbage1Ahead() {
    for(var i = 0; i < garbage1Showing.length; i++) {
        if(garbage1Showing[i].x > mouseX & garbage1Showing[i].x < mouseX + 10) {
            garbage1Showing[i].x = mouseX + 6;
        }
    }   

}

function checkGarbage2Ahead() {
    for(var i = 0; i < garbage2Showing.length; i++) {
        if(garbage2Showing[i].x > mouseX & garbage2Showing[i].x < mouseX + 10) {
            garbage2Showing[i].x = mouseX + 6;
        }
    }   

}



////////////////////////////////////////////////////////////////////////////////////////////////////////////////






For my final project, I have created an ocean clean-up interaction program. Ocean plastics contribute to the rapid increase in the rate of climate change because it acts as a carbon sink. Thus, cleaning up ocean plastics is imperative to slow down the rate of climate change in addition to protecting ocean life.

This program aims to create an abstraction of ocean clean-up and the adverse effects on the environment if pollution is left unattended for too long. The water starts off as a nice, blue color with fish swimming around. Waves are added as extra details to keep the canvas somewhat recognizable as the ocean. As the program continues, trash enters from the left side of the canvas. The trash is represented by randomized rectangles and circles of varying colors and sizes. These objects float towards the center of the canvas on randomized paths. They begin to collect in the middle of the screen, clumping together into a massive garbage patch. As the number of trash objects enters the scene, the water begins to dirty, from a clear blue to a muddy brown—if left out for too long. The fish die-off as the trash on the canvas reaches a certain number.

However, the user is equipped with a net that can be used to clean the garbage. The net is represented by a long, white rectangle. The net works by identifying if a garbage object is within a certain threshold in front of the net. If the trash is within a certain distance in front of the net, it will be sucked in by the net. The user can then use mouseX to push the garbage off the screen to clean the ocean! As trash leaves the screen from the right side of the canvas, the water becomes blue once more. Remember that the net cannot move too fast. If the user is too hasty with their movements of the net, the trash may fall out of the net. Slowly moving the trash off the canvas is the most effective method of cleaning the ocean!

What inspired me to create this program is a video on YouTube by The Ocean Cleanup. They were able to develop a method of cleaning plastics and other pollutants in oceans around the world. They are specifically focusing on cleaning up the Great Pacific Garbage Patch.

If I had more time, I would like to add more detail to the ocean to make the entire program more visually appealing. I would also have liked to use particles and strings to create the net instead of a rectangle. However, I couldn’t figure out how to create a net that you could drag all the particles at once.

In order to run this program, all you have to do is open the index file into the browser of your choice!

Final Project

sketch

//Alana Wu
//ID: alanawu
//Final Project

var buildings = [];
var buildings2 = [];
var buildings3 = [];
var counts = 0;
var fireCount = 0;
var myParticles = [];
var nParticles = 800; 
var group = true;

function setup()
{
    createCanvas(600, 600);
    rectMode(CENTER);
    ellipseMode(CENTER);
    frameRate(10);
    for (var i = 0; i < 10; i++) //makes original buildings in 1st layer
    {
        var rx = random(width);
        buildings[i] = makeBuilding(rx);
    }
    for (var j = 0; j < 8; j++) //makes original buildings in 2nd layer
    {
        var ax = random(width);
        buildings2[j] = makeBuilding2(ax);
    }
    for (var k = 0; k < 8; k++)//makes original buildings in 3rd layer
    {
        var bx = random(width);
        buildings3[k] = makeBuilding3(bx);
    }

    for (var i = 0; i < nParticles; i++) //makes original particles
    {
        var rx = random(width);
        var ry = random(230, 280);
        var p = makeParticle(rx, ry, 0, 0);
        p.bHardBoundaries = true;
        p.damping = 0.99;
        myParticles[i] = p;
    }
}

var desiredSeparation = 50;
var separationFactor = 0.01;
function separate(p) //applies force that separates particles
{ 
    // rule applies if separation is < desired separation, 
    // apply an opposing force to achieve greater separation
    // opposing force grows as the separation becomes less
    for (var i = 0; i < myParticles.length; i++)
    {
        var boid = myParticles[i]; // get each other particle
        var d = dist(p.px, p.py, boid.px, boid.py);
        if (d > 1 & d < desiredSeparation)
        {
            // divide by distance so that the total force is 1
            var fx = (p.px - boid.px) / d;
            var fy = (p.py - boid.py) / d;
            // scale force by (desiredSeparation - d), which
            // is 0 at desiredSeparation and grows as distance
            // becomes less
            var factor = (desiredSeparation - d) * separationFactor;
            p.addForce(fx * factor, fy * factor);
        }
    }
}

function draw()
{
    background(0, 0, counts*5);
    fill (150, 0, 0, 200);
    rect (300, 240, width, 80); //red rect behind 1st layer of buildings
    fill (75, 0, 0, 200);
    rect(300, 175, width, 50); //red rect behind 2nd layer of buildings
    updateAndDisplayBuildings();
    removeBuildingsThatHaveSlippedOutOfView();
    addNewBuildingsWithSomeRandomProbability(); 
    fill (100, 0, 0);
    rect (300, 450, width, 400);
    for (var i = 0; i < myParticles.length; i++) //applies separate to the particles
    {
        var ithParticle = myParticles[i];
        ithParticle.fx = 0;
        ithParticle.fy = 0;
        separate(ithParticle);
    }
 
    for (var i = 0; i < myParticles.length; i++)
    {
        var p = myParticles[i]
        p.update(); // update all locations
        p.draw(); // draw all particles
    }

    oilRig(200, 400); //draws oil rig in foreground
    smokeClouds(110, 90, 30, 25, 240); //draws smoke clouds coming out of oil rig chimneys
    smokeClouds(170, 90, 30, 25, 230);
    smokeClouds(230, 90, 30, 25, 220);
    smokeClouds(140, 90, 30, 25, 200);
    smokeClouds(200, 90, 30, 25, 140);
    if (fireCount > 1) //draws fires in different spots on oil rig as you click the mouse
    {
        push();
        translate (180, 200);
        fire (100, 100, 1);
        pop();
    }
    if (fireCount > 2)
    {
        push();
        translate (0, 320);
        fire(100, 100, 1);
        pop();
    }
    if (fireCount > 3)
    {
        push();
        translate (20, 230);
        fire(100, 100, 1);
        pop();
    }
    if (fireCount > 4)
    {
        push();
        translate (250, 260);
        fire(100, 100, 1);
        pop();
    }
    if (fireCount > 5)
    {
        push();
        translate (110, 240);
        fire(100, 100, 1);
        pop();
    }
    if (fireCount > 6)
    {
        push();
        translate (150, 290);
        fire(100, 100, 1);
        pop();
    }
    if (fireCount > 7)
    {
        push();
        translate (-70, 290);
        fire(100, 100, 1);
        pop();
    }
    if (fireCount > 8)
    {
        push();
        translate (235, 330);
        fire(100, 100, 1);
        pop();
    }
    if (fireCount > 9)
    {
        push();
        translate (-400, 100);
        fire(100, 100, 5);
        pop();
    }
    if (fireCount > 10)
    {
        push();
        translate (-200, 100);
        fire(100, 100, 5);
        pop();
    }
    if (fireCount > 11)
    {
        push();
        translate (0, 100);
        fire(100, 100, 5);
        pop();
    }
    drawButton();
    if (fireCount > 12) //world goes boom once you click enough times. Draws final screen
    {
        fill(255, 0, 0);
        rect(300, 300, width, height);
        textSize(140);
        stroke(255);
        fill(0);
        strokeWeight(8);
        text("BOOM", 85, 300);
        textSize(12);
        noStroke();
        text("RIP humanity.", 15, 580);
    }
}

function fire(x, y, size)
{
    fill (255, 0, 0); //red flame
    beginShape();
    vertex((x + 10)*size, y*size);
    vertex((x + 20)*size, (y - 20)*size);
    vertex((x + 23)*size, (y - 50)*size);
    vertex(x*size, (y - 100)*size);
    vertex((x - 4)*size, (y - 60)*size);
    vertex((x - 12)*size, (y - 80)*size);
    vertex((x - 24)*size, (y - 50)*size);
    vertex((x - 16)*size, (y - 20)*size);
    endShape();

    push(); //orange flame
    fill (255, 130, 0);
    translate(size*32, size*28);
    beginShape();
    vertex((x + 10)*size*.7, y*size*.7);
    vertex((x + 20)*size*.7, (y - 20)*size*.7);
    vertex((x + 23)*size*.7, (y - 50)*size*.7);
    vertex(x*size*.7, (y - 100)*size*.7);
    vertex((x - 4)*size*.7, (y - 60)*size*.7);
    vertex((x - 12)*size*.7, (y - 80)*size)*.7;
    vertex((x - 24)*size*.7, (y - 50)*size*.7);
    vertex((x - 16)*size*.7, (y - 20)*size*.7);
    endShape();
    pop();

    push(); //yellow flame
    fill (255, 255, 0);
    translate(size*65, size*55);
    beginShape();
    vertex((x + 10)*size*.4, y*size*.4);
    vertex((x + 20)*size*.4, (y - 20)*size*.4);
    vertex((x + 23)*size*.4, (y - 50)*size*.4);
    vertex(x*size*.4, (y - 100)*size*.4);
    vertex((x - 4)*size*.4, (y - 60)*size*.4);
    vertex((x - 12)*size*.4, (y - 80)*size)*.4;
    vertex((x - 24)*size*.4, (y - 50)*size*.4);
    vertex((x - 16)*size*.4, (y - 20)*size*.4);
    endShape();
    pop();

}

function smokeClouds(x, y, w, h, col)
{
    fill (col);
    ellipse (x + 35, y - 40, w*1.5, h*1.5);
    ellipse (x + 20, y - 45, w*1.5, h*1.5);
    ellipse (x + 50, y - 55, w*1.5, h*1.5);
    ellipse (x + 25, y - 60, w*1.5, h*1.5);

    ellipse (x, y, w, h);
    ellipse (x + 10, y, w, h);
    ellipse (x, y + 10, w, h);
    ellipse (x - 12, y, w, h);
    ellipse (x - 5, y - 12, w - 10, h - 10);

    ellipse (x - 20, y + 40, w/2, h/2);
    ellipse (x - 23, y + 35, w/2, h/2);
    ellipse (x - 15, y + 35, w/2, h/2);

}

function updateAndDisplayBuildings()//moves the buildings and redraws them
{
    
    for (var i = 0; i < buildings3.length; i++)
    {
        buildings3[i].move();
        buildings3[i].display();
    }
    for (var i = 0; i < buildings2.length; i++)
    {
    buildings2[i].move();
    buildings2[i].display();
    }
    for (var i = 0; i < buildings.length; i++)
    {
        buildings[i].move();
        buildings[i].display();
    }
}


function removeBuildingsThatHaveSlippedOutOfView() //gets rid of building objects we no longer can see
{
    var buildingsToKeep = [];
    for (var i = 0; i < buildings.length; i++)
    {
        if (buildings[i].x + buildings[i].breadth > 0)
        {
            buildingsToKeep.push(buildings[i]);
        }
    }
    buildings = buildingsToKeep;

    var buildings2ToKeep = [];
    for (var i = 0; i < buildings2.length; i++)
    {
        if (buildings2[i].x + buildings2[i].breadth > 0)
        {
            buildings2ToKeep.push(buildings2[i]);
        }
    }
    buildings2 = buildings2ToKeep;

    var buildings3ToKeep = [];
    for (var i = 0; i < buildings3.length; i++)
    {
        if (buildings3[i].x + buildings3[i].breadth > 0)
        {
            buildings3ToKeep.push(buildings3[i]);
        }
    }
    buildings3 = buildings3ToKeep;
}


function addNewBuildingsWithSomeRandomProbability()
{
    var newBuildingLikelihood = 0.02; 
    if (random(0,1) < newBuildingLikelihood)
    {
        buildings.push(makeBuilding(width));
        buildings2.push(makeBuilding2(0));
        buildings3.push(makeBuilding3(width));
    }
}

function buildingMove()
{
    this.x += this.speed;
}
    
function buildingDisplay()
{
    if (this.color == 0)
    {
        fill (255, 0, 255, this.opacity); //light green
    }
    else if (this.color == 1)
    {
        fill(255, 255, 0, this.opacity); //yellow
    }
    else if (this.color == 2)
    {
        fill(255, 0, 0, this.opacity); //red
    }
    else if (this.color == 3)
    {
        fill(0, 0, 255, this.opacity); //blue
    }
    else if (this.color == 4)
    {
        fill (255, 0, 120, this.opacity); //orange
    }
    else if (this.color == 5)
    {
        fill (0, 255, 0, this.opacity); //green
    }
    push();
    translate(this.x, this.layer);
    rect(0, -this.bHeight/2, this.breadth, this.bHeight);
    pop();
}


function makeBuilding(birthLocationX)
{
    var bldg = {x: birthLocationX,
                breadth: random(30, 80),
                speed: -1.0,
                color: int(random(6)),
                opacity: 250,
                bHeight: random(30, 150),
                layer: 250,
                move: buildingMove,
                display: buildingDisplay}
    return bldg;
}

function makeBuilding2(birthLocationX)
{
    var bldg2 = {x: birthLocationX,
                breadth: random(30, 80),
                speed: 1.0,
                color: int(random(5)),
                opacity: 155,
                bHeight: random(50, 150),
                layer: 200,
                move: buildingMove,
                display: buildingDisplay}
    return bldg2;
}


function makeBuilding3(birthLocationX)
{
    var bldg3 = {x: birthLocationX,
                breadth: random(30, 80),
                speed: -1.0,
                color: int(random(5)),
                opacity: 100,
                bHeight: random(50, 150),
                layer: 150,
                move: buildingMove,
                display: buildingDisplay}
    return bldg3;
}


function oilRig (x, y) //all dirty colors
{
    var bounce = 0;
    var dy = -1;
    fill (200);
    noStroke();
    rect (x - 120, y + 100, 50, 80); //base columns
    rect (x + 120, y + 100, 50, 80);

    push();
    translate (0, bounce);
    bounce += dy;
    if (bounce > 5 || bounce < -5)
    {
        dy*= -1;
    }
    fill (130);
    for (var j = 0; j < 5; j++)
    {
        rect (x + 100 - j*30, y - 75 - j*20, 100, 40);
    }
    fill (200);
    var diff = -110;
    for (var i = 0; i < 5; i++)
    {
        rect (x + diff, y - 160, 15, 200);
        diff += 30;
    }
    fill (60);
    rect (x - 90, y - 110, 100, 120);
    fill (80);
    rect (x + 30, y - 90, 100, 70);
    fill (150);
    rect (x - 120, y + 50, 30, 20);
    rect (x + 120, y + 50, 30, 20);   
    fill (100);
    rect (x, y, 350, 100); //big rectangle
    rect (x - 60, y - 80, 100, 60);
    fill (50);
    rect (x - 100, y + 15, 280, 50);
    rect (x + 100, y - 40, 250, 40);
    rect (x + 100, y - 100, 20, 80);
    rect (x + 60, y - 100, 20, 80);
    rect (x + 20, y - 100, 20, 80);
    fill (80);
    rect(x, y - 20, 400, 25);
    fill (150);
    rect (x, y, 400, 10);
    pop();
}

function drawButton() //click here button in bottom right corner
{
    fill(0);
    rect (530, 550, 90, 40);
    fill(255);
    text("CLICK HERE", 493, 553);
    noStroke();
}

function mousePressed() //counts for background color and fires drawn
{
    counts ++;

    if (mouseX > 485 & mouseX < 575 && mouseY > 530 && mouseY < 570)
    {
        fireCount ++;
    }
}

// Update the position based on force and velocity
function particleUpdate()
{
    if (this.bFixed == false) {
        this.vx *= this.damping;
        this.vy *= this.damping;
  
        this.limitVelocities();
        this.handleBoundaries();
        this.px += this.vx;
        this.py += this.vy;
    }
}


// Prevent particle velocity from exceeding maxSpeed
function particleLimitVelocities()
{
    if (this.bLimitVelocities) {
        var speed = sqrt(this.vx * this.vx + this.vy * this.vy);
        var maxSpeed = 14;
        if (speed > maxSpeed) {
            this.vx *= maxSpeed / speed;
            this.vy *= maxSpeed / speed;
        }
    }
}


// do boundary processing if enabled
function particleHandleBoundaries()
{
    if (this.bPeriodicBoundaries)
    {
        if (this.px > width) this.px -= width;
        if (this.px < 0) this.px += width;
        if (this.py > 280) this.py -= height;
        if (this.py < 230) this.py += height;
    } else if (this.bHardBoundaries)
    {
        if (this.px >= width)
        {
            this.vx = -abs(this.vx);
        }
        if (this.px <= 0)
        {
            this.vx = abs(this.vx);
        }
        if (this.py >= 280)
        {
            this.vy = -abs(this.vy);
        }
        if (this.py <= 230)
        {
            this.vy = abs(this.vy);
        }
    }
}


// draws particles as circles
function particleDraw()
{
    fill(200, 200, 200, 100);
    noStroke();
    ellipse(this.px, this.py, 18, 18);
}


// add a force to the particle using F = mA
function particleAddForce(fx, fy)
{
    var ax = fx / this.mass;
    var ay = fy / this.mass;
    this.vx += ax;
    this.vy += ay;
}


// make a new particle
function makeParticle(x, y, dx, dy)
{
    var p = {px: x, py: y, vx: dx, vy: dy,
             mass: 1.0, damping: 0.9,
             bFixed: false,
             bLimitVelocities: true,
             bPeriodicBoundaries: false,
             bHardBoundaries: true,
             addForce: particleAddForce,
             update: particleUpdate,
             limitVelocities: particleLimitVelocities,
             handleBoundaries: particleHandleBoundaries,
             draw: particleDraw
            }
    return p;
}




For this program, I started with the idea of the ruins of human cities. Originally, I wanted to do something with skylines, but in the final project, I instead have three layers of simple buildings moving across the landscape background.
In the midground, I modified the particles program that we went through during class to create an effect that looks like roiling fog.
In the foreground, I drew a large oil rig in various shades of gray to contrast with the bright and colorful background.
As the user clicks the “click me” button, small fires appear on the oil rig. After enough clicks, huge fires appear on the screen, ending with a screen that says BOOM after the oil rig explodes.

I wanted to refrain from using images, so the program has more of a game-like appearance, making a climate apocalypse seem like a “game over”.

Project 11: Generative Landscape

sketchDownload
//global variables
var cloudsX = [];
var cloudsY = [];
var brickX = [];
var brickY = [];
var mushroomX = [];
var mushroomY = [];
var cloudImg;
var brickImg;
var floorImg;
var noiseParam = 0;
var noiseStep = 0.01;
var numClouds = 5;
var numBricks = 3;
var numMushrooms = 3;
var mh = []; //height of the mountains

function preload() { 
  //preload images
  cloudImg = loadImage("https://i.imgur.com/i3pLDv0.png");
  brickImg = loadImage("https://i.imgur.com/yNNs74U.png");
  floorImg = loadImage("https://i.imgur.com/LZwSMdA.png");
  mushroomImg = loadImage("https://i.imgur.com/tflvlXK.png");
}

function setup() {
  createCanvas(480, 400);

  //mountain
  for (var i = 0; i < width/2 + 1; i ++) {
    var n = noise(noiseParam);
    var v = map(n, 0, 1, height/2, height);
    mh.push(v);
    noiseParam += noiseStep;
  }

  //cloud
  for (var i = 0; i < numClouds; i ++) {
    var cx = random(width/numClouds*i, width/numClouds*(i+1));
    var cy = random(height/4);
    cloudsX.push(cx);
    cloudsY.push(cy);
  }

  //brick
  for (var i = 0; i < numBricks; i ++) {
    var bx = random(width/numBricks*i, width/numBricks*(i+1));
    var by = random(height/3, height/2);
    brickX.push(bx);
    brickY.push(by);
  }

  //mushroom
  for (var i = 0; i < numMushrooms; i ++) {
    var mx = random(width/numMushrooms*i, width/numMushrooms*(i+1));
    var my = height-90;
    mushroomX.push(mx);
    mushroomY.push(my);
  }
  frameRate(10);
}

function draw() {
  background(102, 154, 255); //blue
  drawMountain();
  drawCloud();
  drawBrick();
  drawMushroom();

//floor
  image(floorImg, 0, 340, 130, 30);
  image(floorImg, 129, 340, 130, 30);
  image(floorImg, 258, 340, 130, 30);
  image(floorImg, 387, 340, 130, 30);
  image(floorImg, 0, 370, 130, 30);
  image(floorImg, 129, 370, 130, 30);
  image(floorImg, 258, 370, 130, 30);
  image(floorImg, 387, 370, 130, 30);
}

//mountains
function drawMountain() {
  fill(52, 151, 9); //green
  beginShape();
  vertex(0, height);
  for (var i = 0; i < mh.length; i ++) {
    x = 2*i;
    y = mh[i];
    vertex(x,y);
  }
  vertex(width, height);
  endShape();
  mh.shift();
  n = noise(noiseParam);
  v = map(n, 0, 1, height/2, height);
  mh.push(v);
  noiseParam += noiseStep;
}

//cloud
function drawCloud() {
  for (var i = 0; i < numClouds; i ++) {
    image(cloudImg, cloudsX[i], cloudsY[i], 100, 33);
  }
  for (var i = 0; i < numClouds; i ++) {
    cloudsX[i] -= 3; //update cloud position
    if (cloudsX[i] < -100) { //remove cloud
      cloudsX[i] = width;
      cloudsY[i] = random(height/4);
    }
  }
}

//brick
function drawBrick() {
  for (var i = 0; i < numBricks; i ++) {
    image(brickImg, brickX[i], brickY[i], 100, 30);
  }
  for (var i = 0; i < numBricks; i ++) {
    brickX[i] -= 3; //update brick position
    if (brickX[i] < -100) { //remove cloud
      brickX[i] = width;
      brickY[i] = random(height/3, height/2);
    }
  }
}


//mushroom
function drawMushroom() {
  for (var i = 0; i < numMushrooms; i ++) {
    image(mushroomImg, mushroomX[i], mushroomY[i], 40, 30);
  }
  for (var i = 0; i < numMushrooms; i ++) {
    mushroomX[i] -= 7; //update brick position
    if (mushroomX[i] < -100) { //remove cloud
      mushroomX[i] = width;
      mushroomY[i] = height-90;
    }
  }
}

For this project, I decided to replicate one of my favorite childhood game, Super Mario Bros Game we used to play with Nintendo. For moving variables, I added clouds, bricks, mushrooms and the mountain the background, and included floor tiles using png files. It was challenging at first to make them move and disappear, but it was really fun to create this game-like scenery. If I had more time, I would like to add a jumping Mario so the character interacts with the game scene.

Project 11: Generative Landscape

sketch
var sushi=["https://i.imgur.com/77xfiZT.png", "https://i.imgur.com/LEndRAV.png", "https://i.imgur.com/d1fWjnJ.png", "https://i.imgur.com/UyTqQin.png"];

let belt;
var sushi1;
var sushi2; 
var sushi3;
var sushi4;
//var x = 80;
var speed= 7;

var plate=[];
var inChopstick=false;
var nSushi=200;
var x=0;
var speed=7;

function preload() {
    belt = loadImage("https://i.imgur.com/zBwKyLa.png")
    sushi1=loadImage(sushi[0]);
    sushi2=loadImage(sushi[1]);
    sushi3=loadImage(sushi[2]);
    sushi4=loadImage(sushi[3]);
}

function setup() {
    createCanvas(500, 400);
    var n = 0;
    for (var i = 0; i < 1000; i++){ //continually creates (1000) plates of sushi 
        plate[i] = makePlate(n);
        n -= 200;
    }
    frameRate(30);
}

function draw() {
    background(0);
    image(belt,0,0);
    plateShow();
}

function plateGo(){
    this.x+=this.dx;
}
function plateShow(){
    for(var i = 0; i < plate.length; i++){
        plate[i].go();
        plate[i].show();
        // plate[i].mP();
    }
}

function makePlate(px){
    var plate={x: px, y:180, w:150, h:100,
    dx: 7, go:plateGo, show:drawPlate,
    sushi: random([sushi1, sushi2, sushi3, sushi4]),
    }
    return plate;
}

function drawPlate(){
    push();
    fill(215);
    noStroke();
    ellipse(this.x, this.y, this.w, this.h);
    stroke(185);
    noFill();
    ellipse(this.x, this.y, 0.75*this.w, 0.75*this.h);
    if (this.sushi==sushi1){
            image(sushi1, this.x-50, 0);
        }
    if (this.sushi==sushi2){
        image(sushi2, this.x-50, 0);
         }
    if (this.sushi==sushi3){
        image(sushi3, this.x-50, 0);
         }
    if (this.sushi==sushi4){
        image(sushi4, this.x-50, 0);
         } 
     

}


Looking Outwards 11: Societal Impacts of Digital Art

https://www.arts.gov/impact/media-arts/arts-technology-scan/essays/how-artists-can-bridge-digital-divide-and-reimagine-humanity

This week’s looking out is very interesting. Reading about how NFT have a positive impact onto bridging digital divides was a new way to see them. Originally, I thought NFTs had a rather negative impact: influencing careless spending and money onto temporary “tangible” things. The article I read about speaks about how artists bridge the digital divide and reimagined humanity. New digital artists can solve digital divide: the gap between those who benefit from the digital age and those who do not. These artists would appeal to digital capacity-building:harnessing wonder, digital public goods: creating shareable resources, digital inclusion: using the STEMarts Model, etc. The model highlights creating an equitable and a sustainable digital society is essential to the process of digital cooperation. People are brought together from diverse disciplines and cultural perspectives in order to create alternative futures. In a contemporary world of complexity, most approaches are insufficient while the problem is urgent. The experimentation with technologies could foster literacies and bridge social divides.