{"id":73045,"date":"2022-09-25T16:23:51","date_gmt":"2022-09-25T20:23:51","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/?p=73045"},"modified":"2022-09-25T16:23:51","modified_gmt":"2022-09-25T20:23:51","slug":"anabelles-project-04","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/2022\/09\/25\/anabelles-project-04\/","title":{"rendered":"anabelle&#8217;s project 04"},"content":{"rendered":"<!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/REC-html40\/loose.dtd\">\n<html><body><div><a class=\"p5_sketch_link\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/09\/sketch-385.js\" data-width=\"400\" data-height=\"300\">sketch<\/a>\n\n\n\n\n\n<p>Here&rsquo;s my project for the week &mdash; this has been the most painful one so far. It&rsquo;s vaguely based off of Rainbow Road from Mario Kart, so enjoy &lt;3<\/p><iframe src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/plugins\/p5-embedder\/p5_iframe.html\" class=\"p5_exampleFrame\" width=\"400\" height=\"300\"><\/iframe><pre class=\"language-javascript\"><code class=\"p5_editor language-javascript\">let numLines; \n\nlet expandLeft;\nlet expandRight;\n\nlet moveX;\nlet moveY;\n\nlet lineExpand;\n\nfunction setup() {\n    createCanvas(400, 300);\n}\n\nfunction draw() {\n    background(0, 0, 56);\n\n    stroke(255); \/\/ circle\n    lineExpand = (constrain(mouseY, 10, 400));\n    for(i = 0; i &lt;= 100; i +=1 ) {\n        push();\n        translate(width\/2, height\/2);\n        rotate(radians(10*i));\n        line(0, lineExpand, 0, -lineExpand);\n        pop();\n    }\n\n    stroke(188, 13, 88); \/\/ red\n    crossHatch(0, 290, 150, 200, 170, 200, 200, 0, false);\n\n    stroke(254, 161, 43); \/\/ orange\n    crossHatch(5, 290, 170, 220, 190, 220, 200, 0, false);\n\n    stroke(248, 243, 23); \/\/ yellow \n    crossHatch(10, 290, 190, 250, 210, 250, 200, 0, false);\n\n    stroke(247, 89, 252); \/\/ purple \n    crossHatch(390, 290, 250, 200, 230, 200, 200, 0, false);\n\n    stroke(79, 134, 239); \/\/ blue\n    crossHatch(395, 290, 230, 220, 210, 220, 200, 0, false);\n\n    stroke(118, 370, 153); \/\/ green\n    crossHatch(400, 290, 210, 250, 190, 250, 200, 0, false);\n\n    stroke('magenta');\n    moveX = 100;\n    moveY = 100;\n    chadStar(0, 0);\n\n    stroke('yellow');\n    moveX = 300;\n    moveY = 200;\n    chadStar(0, 0);\n\n    stroke('pink');\n    moveX = 250;\n    moveY = 50;\n    chadStar(0, 0);\n\n}\n\n\n\nfunction crossHatch(firstx1, firsty1, firstx2, firsty2, secondx1, secondy1, secondx2, secondy2, showLines = true) {\n    if (showLines){\n        line(firstx1, firsty1, firstx2, firsty2);\n        line(secondx1, secondy1, secondx2, secondy2);\n    } \n\n    let numLines = constrain(mouseX, 100, 400)\/10;\n\n\n    let dx1 = (firstx2 - firstx1) \/ numLines;\n    let dy1 = (firsty2 - firsty1) \/ numLines;\n    let dx2 = (secondx2 - secondx1) \/ numLines;\n    let dy2 = (secondy2 - secondy1) \/ numLines;\n\n\n    for(var i = 0; i &lt;= numLines; i += 1) {\n        line(firstx1, firsty1, secondx1, secondy1);\n        firstx1 += dx1;\n        firsty1 += dy1;\n        secondx1 += dx2;\n        secondy1 += dy2;\n    }\n}\n\nfunction chadStar(x, y) {\n    expandLeft = constrain(mouseY, 0, 300) \/ 50;\n    expandRight = constrain(mouseY, 0, 300) \/ 50;\n\n    for(i = 0; i &lt;= 6; i += 1) {\n        push();\n        translate(moveX, moveY);\n\n        rotate(radians(i*60));\n        line(x, y-10, x+10, y+10);\n        line(x+10, y+10, x-10, y+10);\n        line(x-10, y+10, x, y-10);\n\n        pop();\n        \n        x += expandLeft;\n        y += expandRight;\n    }\n}\n<\/code><\/pre><\/div><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>sketch Here&rsquo;s my project for the week &mdash; this has been the most painful one so far. It&rsquo;s vaguely based off of Rainbow Road from Mario Kart, so enjoy &lt;3 let numLines; let expandLeft; let expandRight; let moveX; let moveY; let lineExpand; function setup() { createCanvas(400, 300); } function draw() { background(0, 0, 56); stroke(255); &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/2022\/09\/25\/anabelles-project-04\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;anabelle&#8217;s project 04&#8221;<\/span><\/a><\/p>\n","protected":false},"author":734,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[102,57,1],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/73045"}],"collection":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/users\/734"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/comments?post=73045"}],"version-history":[{"count":1,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/73045\/revisions"}],"predecessor-version":[{"id":73046,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/73045\/revisions\/73046"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/media?parent=73045"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/categories?post=73045"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/tags?post=73045"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}