{"id":69292,"date":"2021-12-03T22:56:59","date_gmt":"2021-12-04T03:56:59","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/?p=69292"},"modified":"2021-12-03T22:56:59","modified_gmt":"2021-12-04T03:56:59","slug":"final-project-4","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/12\/03\/final-project-4\/","title":{"rendered":"Final Project"},"content":{"rendered":"<!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/REC-html40\/loose.dtd\">\n<html><body><p>For my final project, I was inspired by the capitalist need for consumption over all else. Specifically, I&rsquo;ve been concerned with over-fishing (I even wrote one of my essays to apply to CMU about fishing net pollution). So, I created a game that simulates capitalist motives in regards to fishing. <\/p>\n\n\n\n<p>In the game, your cursor becomes a fishing hook which you can use to click on the fish and catch them. This will momentarily make the screen flash green and increase the amount of money you&rsquo;ve made. However, once all the fish are caught, the coral dies off and the ocean becomes much less vibrant than it was before. Finally, a message will pop up warning the player about the effects of over-fishing. However, if the player goes for a minute and a half without killing all the fish, a message will pop up to congratulate them on being a conscious consumer. <\/p>\n\n\n\n<p>I added everything I intended for the program, but I can definitely see how I could add more aspects to make this a more complete and polished screen, like a system to replenish the fish gradually. Also, moving seaweed or bubbles might be nice. But I am happy with this outcome. <\/p>\n\n\n\n<p><a class=\"p5_sketch_link\" data-width=\"600\" data-height=\"300\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/12\/sketch-11.js\">sketch<\/a><iframe src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/plugins\/p5-embedder\/p5_iframe.html\" class=\"p5_exampleFrame\" width=\"600\" height=\"300\"><\/iframe><pre class=\"language-javascript\"><code class=\"p5_editor language-javascript\">\/\/Elise Chapman\n\/\/ejchapma\n\/\/ejchapma@andrew.cmu.edu\n\/\/Section D\n\nf=[]; \/\/array for the fish\nfClick=[]; \/\/array for tracking the clicked \nvar sandy = []; \/\/for the sand\nvar noiseParam = 5; \/\/for the sand\nvar noiseStep = 0.005; \/\/for the sand\n\/\/color variables so that the coral can turn gray\nvar tube1;\nvar tube2;\nvar tube3;\nvar brain1;\nvar brain2;\nvar gray1=125;\nvar gray2=100;\nvar moneyCount=0; \/\/counts the money\nvar timer=0; \/\/for tracking after fish die\nvar timerLive=0; \/\/for tracking time for player for being good\n\nfunction setup() {\n    createCanvas(600, 300);\n    rectMode(CENTER);\n    strokeJoin(ROUND);\n    textAlign(CENTER,CENTER);\n    noCursor();\n    frameRate(10);\n    \/\/fish setup\n    for (var i=0; i&lt;20; i+=1) {\n        f[i]=new Object();\n        f[i].x=random(30,width-31);\n        f[i].y=random(75,height-31);\n        f[i].dx=random(-10,11); \/\/change in x\n        r=int(random(0,256));\n        \/\/g=int(random(0,256));\n        b=int(random(0,256));\n        f[i].c=color(r,0,b); \/\/fish color\n    }\n\n    \/\/for the sand\n    noiseSeed(87);\n    for (var i=0; i&lt;(width\/5)+1; i+=1) {\n        var n=noise(noiseParam);\n        var value=map(n,0,1,0,height);\n        sandy[i]=value;\n        noiseParam+=noiseStep;\n    }\n\n    \/\/tube colors\n    tube1=color(67,87,173) \/\/blue\n    tube2=color(242,160,242); \/\/pink\n    tube3=color(239,99,81); \/\/red\n    brain1=color(97,208,149); \/\/green\n    brain2=color(249,199,132); \/\/yellow\n}\n\nfunction draw() {\n    if (f.length&lt;1 & timer>90) {\n        background(122,161,187); \/\/darker ocean blue\n    } else {\n        background(74,225,255); \/\/ocean blue\n    }\n    sandscape();\n    coral();\n    seaweed(15,100);\n    seaweed(40,175);\n    seaweed(250,200);\n    seaweed(275,75);\n    seaweed(300,125);\n    seaweed(450,225);\n    seaweed(550,175);\n    seaweed(575,100);\n    \/\/fish\n    for (var i=0; i&lt;f.length; i+=1) {\n        fish(f[i].x,f[i].y,f[i].dx,f[i].c);\n        f[i].x+=f[i].dx;\n        if (f[i].x&lt;15 || f[i].x&gt;width-15) {\n        f[i].dx=-f[i].dx;\n        }\n    }\n    \/\/bad ending\n    if (timer&gt;120 & f.length<1) {\n        push();\n        translate(width\/2,height\/2)\n        noStroke();\n        fill(0,0,0,200);\n        rect(0,0,600,300);\n        strokeWeight(1);\n        stroke(255);\n        fill(255);\n        text(\"You've chosen greed over the fish.\\nOver-fishing is one of the greatest causes \\nof devastation for our oceans.\\nDoes making a quick buck make killing the coral worth it?\\nI should hope not.\\nAlways choose the environment.\"\n            ,0,0);\n        pop();\n    }\n    \/\/money\n    noStroke();\n    fill(255); \/\/white\n    rect(75,30,100,50,10,10,10,10);\n    strokeWeight(2);\n    stroke(0,122,4); \/\/green\n    fill(0,122,4); \/\/green\n    textSize(20);\n    text(\"$\"+str(moneyCount),75,30);\n    \/\/fish hook\n    if (f.length&gt;0) {\n        fishHook(mouseX,mouseY);\n    }\n    if (f.length&lt;1) {\n        timer++;\n    }\n    \/\/good ending\n    if (timerLive&gt;6300 & f.length>1) {\n        push();\n        translate(width\/2,height\/2)\n        noStroke();\n        fill(0,0,0,200);\n        rect(0,0,600,300);\n        strokeWeight(1);\n        stroke(255);\n        fill(255);\n        text(\"Congrats!\\nYou've chosen to fish sustainably, or not at all.\\nAs over-fishing continues to be a source of \\ndevastation for our oceans, please continue\\nto advocate for healthy fishing!\\n:)\"\n            ,0,0);\n        pop();\n    }\n    timerLive++;\n}\n\n\/\/swimming fish\nfunction fish(x,y,dx,c) {\n    noStroke();\n    fill(c);\n    ellipse(x,y,40,30);\n    \/\/moving left\n    if (dx&lt;0) {\n        triangle(x+15,y,x+30,y+15,x+30,y-15);\n        triangle(x-20,y,x+10,y-25,x+10,y);\n        triangle(x-20,y,x+10,y+25,x+10,y);\n        fill(0);\n        ellipse(x-7,y-3,9);\n    \/\/moving right\n    } else if (dx&gt;=0) {\n        triangle(x-15,y,x-30,y+15,x-30,y-15);\n        triangle(x+20,y,x-10,y-25,x-10,y);\n        triangle(x+20,y,x-10,y+25,x-10,y);\n        fill(0);\n        ellipse(x+7,y-3,9);\n    }\n}\n\n\/\/landscape made of sand\nfunction sandscape() {\n    \/\/sets up the sand\n    strokeWeight(3);\n    stroke(242,231,189); \/\/beige\n    fill(242,231,189); \/\/beige\n\n    \/\/creates the sand\n    push();\n    translate(0,10);\n    beginShape();\n    vertex(0,height);\n    for (var i=0; i&lt;(width\/5)+1; i+=1) {\n        vertex(i*5,sandy[i]);\n    }\n    vertex(width,height);\n    endShape();\n    pop();\n}\n\n\/\/coral reef has got to have coral\nfunction coral() {\n    \/\/tube coral\n    if (f.length&lt;1 & timer>70) {\n        fill(gray1);\n        stroke(gray1);\n    } else {\n        fill(tube1);\n        stroke(tube1);\n    }\n    strokeWeight(8);\n    var place = 500; \/\/easier to adjust coral placement\n    quad(place,200,place+20,200,place+30,70,place,70);\n    quad(place-30,210,place,210,place-10,100,place-30,100);\n    quad(place-60,190,place-40,190,place-30,50,place-70,40);\n    quad(place-90,200,place-60,200,place-70,130,place-80,130);\n    if (f.length&lt;1 & timer>20) {\n        fill(gray1);\n        stroke(gray1);\n    } else {\n        fill(tube2);\n        stroke(tube2);\n    }\n    place = 150;\n    quad(place-30,250,place-50,250,place-50,120,place-20,120);\n    quad(place+30,260,place,260,place+10,150,place+30,150);\n    quad(place+60,240,place+40,240,place+30,100,place+70,90);\n    quad(place-90,250,place-60,250,place-70,180,place-80,180);\n\n    \/\/brain coral\n    if (f.length&lt;1 & timer>10) {\n        fill(gray2);\n        stroke(gray2);\n    } else {\n        fill(brain1);\n        stroke(brain1);\n    }\n    ellipse(400,200,100,70);\n    if (f.length&lt;1 & timer>50) {\n        fill(gray2);\n        stroke(gray2);\n    } else {\n        fill(brain2);\n        stroke(brain2);\n    }\n    ellipse(10,150,100,70);\n\n    \/\/another tube coral\n    if (f.length&lt;1 & timer>30) {\n        fill(gray1);\n        stroke(gray1);\n    } else {\n        fill(tube3);\n        stroke(tube3);\n    }\n    place = 300;\n    quad(place+30,340,place,360,place+10,200,place+30,190);\n    quad(place+60,360,place+40,360,place+30,250,place+70,250);\n}\n\n\/\/makes the cursor look a certain way\nfunction fishHook(x,y) {\n    noFill();\n    stroke(255);\n    strokeWeight(10);\n    beginShape();\n    vertex(x+40,y-50);\n    vertex(x+40,y-50);\n    vertex(x+40,y);\n    curveVertex(x+20,y+10);\n    curveVertex(x,y);\n    vertex(x,y);\n    endShape();\n    fill(80);\n    triangle(x-5,y+10,x+10,y-10,x-5,y-10);\n}\n\n\/\/underwater has to have seaweed\nfunction seaweed(x,height) {\n    strokeWeight(5);\n    stroke(0,122,4); \/\/green\n    fill(0,122,4); \/\/still green\n    triangle(x,350,x+20,350,x+10,height);\n}\n\nfunction mousePressed() {\n    for (var i=0; i&lt;f.length; i+=1) {\n        if (dist(mouseX,mouseY, f[i].x,f[i].y)&lt;30) {\n            f.splice(i,1);\n            fill(0,122,4,100); \/\/green\n            rect(width\/2,height\/2,600,300);\n            moneyCount+=10000;\n            break;\n        }\n    }\n}\n\n<\/code><\/pre><\/p><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>For my final project, I was inspired by the capitalist need for consumption over all else. Specifically, I&rsquo;ve been concerned with over-fishing (I even wrote one of my essays to apply to CMU about fishing net pollution). So, I created a game that simulates capitalist motives in regards to fishing. In the game, your cursor &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/12\/03\/final-project-4\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Final Project&#8221;<\/span><\/a><\/p>\n","protected":false},"author":644,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[116,58],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/69292"}],"collection":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/users\/644"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/comments?post=69292"}],"version-history":[{"count":1,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/69292\/revisions"}],"predecessor-version":[{"id":69294,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/69292\/revisions\/69294"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/media?parent=69292"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/categories?post=69292"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/tags?post=69292"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}