{"id":68892,"date":"2021-11-08T10:53:32","date_gmt":"2021-11-08T15:53:32","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/?p=68892"},"modified":"2021-11-08T10:53:32","modified_gmt":"2021-11-08T15:53:32","slug":"project-10-animation","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/11\/08\/project-10-animation\/","title":{"rendered":"Project 10: Animation"},"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><a class=\"p5_sketch_link\" data-width=\"400\" data-height=\"400\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/11\/sketch-40.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=\"400\" height=\"400\"><\/iframe><pre class=\"language-javascript\"><code class=\"p5_editor language-javascript\">\/\/ gnmarino\n\/\/ gia marino\n\/\/ class section D\n\n\/\/ the story is suppose to be up to your own interruptation.\n\/\/ the main point is someone is trying to reach love and they can't so \n\/\/ a friend has to help them out. The concept is about how sometimes\n\/\/ you need a friend's help even if it's a little thing\n\nvar rope; \/\/ rope swinging noise\nvar heart; \/\/ heart's voice\nvar char1; \/\/ 1st character's voice\nvar walking; \/\/ 2nd character's walking\nvar counter = 0; \/\/ counts the frames\nvar animationImages = []; \/\/ holds images for animation\n\nfunction preload() {\n    rope = loadSound(\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/11\/Rope-Sound.wav\");\n    heart = loadSound(\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/11\/Heart.wav\");\n    char1 = loadSound(\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/11\/character1noise.wav\");\n    walking = loadSound(\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/11\/walking.wav\")\n\n    var imageNames = [];\n    imageNames[0] = \"https:\/\/i.imgur.com\/ZP19uwT.jpg\";\n    imageNames[1] = \"https:\/\/i.imgur.com\/4Bl2ivM.jpg\"\n    imageNames[2] = \"https:\/\/i.imgur.com\/VaO2Qof.jpg\"\n    imageNames[3] = \"https:\/\/i.imgur.com\/tpxAt2V.jpg\"\n    imageNames[4] = \"https:\/\/i.imgur.com\/nkNrX5Y.jpg\"\n    imageNames[5] = \"https:\/\/i.imgur.com\/HEE2XA5.jpg\"\n    imageNames[6] = \"https:\/\/i.imgur.com\/7vkRyqN.jpg\"\n    imageNames[7] = \"https:\/\/i.imgur.com\/FOvHPju.jpg\"\n    imageNames[8] = \"https:\/\/i.imgur.com\/22f630s.jpg\"\n    imageNames[9] = \"https:\/\/i.imgur.com\/7bbhlOa.jpg\"\n    imageNames[10] = \"https:\/\/i.imgur.com\/Ke1o6Gb.jpg\"\n    imageNames[11] = \"https:\/\/i.imgur.com\/hnSXa9y.jpg\"\n    imageNames[12] = \"https:\/\/i.imgur.com\/HPLomd1.jpg\"\n    imageNames[13] = \"https:\/\/i.imgur.com\/ifo5g3u.jpg\"\n    imageNames[14] = \"https:\/\/i.imgur.com\/cedp6AC.jpg\"\n    imageNames[15] = \"https:\/\/i.imgur.com\/6XxqZ1u.jpg\"\n    imageNames[16] = \"https:\/\/i.imgur.com\/rhEs6bx.jpg\"\n    imageNames[17] = \"https:\/\/i.imgur.com\/o5VujYT.jpg\"\n    imageNames[18] = \"https:\/\/i.imgur.com\/9nXwcuh.jpg\"\n    imageNames[19] = \"https:\/\/i.imgur.com\/07qlded.jpg\"\n    imageNames[20] = \"https:\/\/i.imgur.com\/wH2NFj7.jpg\"\n    imageNames[21] = \"https:\/\/i.imgur.com\/qB6Ayi0.jpg\"\n    imageNames[22] = \"https:\/\/i.imgur.com\/AM8eMi3.jpg\"\n    imageNames[23] = \"https:\/\/i.imgur.com\/uOzyybS.jpg\"\n    imageNames[24] = \"https:\/\/i.imgur.com\/vnEhu5u.jpg\"\n    imageNames[25] = \"https:\/\/i.imgur.com\/SEA3Z8z.jpg\"\n\n    for (var i = 0; i &lt; imageNames.length; i++){\n        animationImages[i] = loadImage(imageNames[i]);\n    }\n}\n\nfunction setup() {\n    createCanvas(400, 400);\n    useSound();\n    frameRate(1);\n    background(200);\n}\n\nfunction soundSetup() { \/\/ setup for audio generation\n    rope.setVolume(0.5);\n    heart.setVolume(0.5);\n    char1.setVolume(0.5);\n    walking.setVolume(0.5);\n}\n\nfunction draw() {\n\n    \/\/ displays an image every frame\n    image(animationImages[counter], 0, 0, 400, 500);\n\n    \/\/ all the if statements state what frame each noise will play\n    if (counter == 1 || counter == 11 || counter == 24) {\n        char1.play();\n    }\n    if ( counter == 4 || counter == 25) {\n        heart.play();\n    }\n    if (counter == 6) {\n        rope.play();\n    }\n    if (counter == 13 || counter == 15) {\n        walking.play();\n    }\n\n    counter ++\n\n    \/\/ ends animation\n    if (counter == animationImages.length+1) {\n        background(0);\n        noLoop();\n    }\n}\n\n<\/code><\/pre><\/p>\n\n\n\n<p>For my project this week I wanted to story to be interrupted however you wanted. So the actual story is quite simple but you could get many different means out of the animation. My four sounds were the heart&rsquo;s voice, the rope moving, character 1&rsquo;s voice, and character 2&rsquo;s footsteps.<\/p><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>sketch \/\/ gnmarino \/\/ gia marino \/\/ class section D \/\/ the story is suppose to be up to your own interruptation. \/\/ the main point is someone is trying to reach love and they can&#8217;t so \/\/ a friend has to help them out. The concept is about how sometimes \/\/ you need a &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/11\/08\/project-10-animation\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Project 10: Animation&#8221;<\/span><\/a><\/p>\n","protected":false},"author":658,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[113,58],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/68892"}],"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\/658"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/comments?post=68892"}],"version-history":[{"count":1,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/68892\/revisions"}],"predecessor-version":[{"id":68907,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/68892\/revisions\/68907"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/media?parent=68892"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/categories?post=68892"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/tags?post=68892"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}