{"id":75609,"date":"2022-11-12T21:08:48","date_gmt":"2022-11-13T02:08:48","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/?p=75609"},"modified":"2022-11-13T11:12:32","modified_gmt":"2022-11-13T16:12:32","slug":"srishtys-project-10","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/2022\/11\/12\/srishtys-project-10\/","title":{"rendered":"Srishty&#8217;s Project 10"},"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><\/p>\n\n\n\n<p>I made a simple story about a girl (me) who goes on a walk to the park. During her time there as she walks by, she sees tom and jerry start chasing each other all over the park and she starts laughing. The background d elements and all elements other than tom and jerry were done on illustrator and imported to imgur. My 4 characters are the cloud making the wind sound, the tom making the meow sound, the girl laughing, and the bird chirping.<\/p>\n\n\n\n<p><a class=\"p5_sketch_link\" data-width=\"400\" data-height=\"400\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/11\/sketch-copy.js\">sketch<\/a><iframe src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/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\">\/\/ SRISHTY BHAVSAR\n\/\/SECTION C\n\/\/PROJECT 10\n\/*\nI made a simple story about a girl (me) who goes on a walk to the park. During her time there as she walks by, \nshe sees tom and jerry start chasing each other all over the park and\nshe starts laughing. The background d elements and all elements other than tom and jerry were done on illustrator\nand imported to imgur. My 4 characters are the cloud making the wind sound, the tom making the meow sound, the girl \nlaughing, and the bird chirping.\n*\/\n\n\n\n\/\/ call global variables\n\n\/\/background image\nvar bgPhoto\n\n\/\/CHARACTERS\n\/\/ cloud\n    var cloudX = 0;\n\n    \/\/ bird\n    var birdImage = [];\n    var birdX = 500;\n    var birditem = 0;\n    var birdwidth = 80\n\n    \/\/ srishty (me)\n    var srishtyImage;\n    var srishtyx =500;\n\n    \/\/ cloud\n    var cloudImage;\n    var cloudx = 300\n\n    \/\/ tom and jerry\n    var tomandjerry = [];\n    var tomandjerryx = 70;\n    var tomandjerryitem = 0;\n    var tjdy = 1\n    var tjdx = 1\n\n\/\/ frame counter initializer\nvar count = 0; \n\n\n\n\n\/\/load images to imgur\nfunction preload() {\n    bgPhoto = loadImage(\"https:\/\/i.imgur.com\/75aDbMe.png\");\n    \/\/ images\n    birdImage[0] = loadImage(\"https:\/\/i.imgur.com\/o1P0pBO.png\"); \/\/ first image in the bird list\n    birdImage[1] = loadImage(\"https:\/\/i.imgur.com\/48woLcm.png\"); \/\/ first image in the bird list\n    srishtyImage = loadImage(\"https:\/\/i.imgur.com\/b5N2LzO.png\"); \/\/ srishty image\n    cloudImage = loadImage(\"https:\/\/i.imgur.com\/xG8RjYF.png\"); \/\/ cloud image\n    tomandjerry[0] =loadImage(\"https:\/\/i.imgur.com\/8nNCYkE.png\");\n    tomandjerry[1] =loadImage(\"https:\/\/i.imgur.com\/cDSNU65.png\");\n    tomandjerry[2] =loadImage(\"https:\/\/i.imgur.com\/LcYpbag.png\");\n    tomandjerry[3] =loadImage(\"https:\/\/i.imgur.com\/wYhvMJo.png\"); \n\n    \/\/sounds\n    wind = loadSound(\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/11\/wind.wav\");\n    meow = loadSound(\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/11\/meow.wav\");\n    laugh = loadSound(\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/11\/laugh.wav\");    \n    chirp = loadSound(\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/11\/chirp.wav\");  \n}\n\n\nfunction soundSetup(){\n    wind.setVolume(.1);\n    meow.setVolume(2);\n    chirp.setVolume(.1);\n    laugh.setVolume(2);\n}\n\nfunction setup() {\n    createCanvas(400, 400);\n    \/\/frameRate(5);\n    imageMode(CENTER);\n    useSound();\n\n}\n\nfunction draw() {\n    count++; \/\/ add one frame to draw function\n    \/\/background image\n    image(bgPhoto, width\/2, height\/2, width, height);\n\n\n\n    wind.play();\n    chirp.play();\n\n\n\n    \/\/call characters\n    drawCloud();\n    drawbird();\n    drawTandJ()\n    drawSrishty();\n  \n    if (count == 450 || count == 750) {\n        meow.play();\n    }\n    if (count == 500 || count ==800) {\n        laugh.play();\n    }\n}\n\n\/\/ function for bird flapping\n\nfunction drawbird() {\n\n    image(birdImage[birditem], birdX, 104, birdwidth,30); \n    \/\/ if the frame counter is odd have the bird's item be the first one, if even have it be the second one \n    \/\/fkapping affect \n    if (count % 2 === 0 ) { \/\/ bird frame 1\n        birditem = 1;\n        birdwidth = 100\n        birdX -= .5; \/\/ bird flies to left\n    }\n    if (count % 2 === 1 ) {    \/\/ bird frame 0\n        birditem = 0;\n        birdwidth = 80;\n        birdX -= .5; \/\/ bird flies to left\n    }\n\n}\n\nfunction drawSrishty() {\n    var heightcount = .5\n    if (count &gt;= 30) { \/\/ srishty walks in 30 frames after bird\n\n        \/\/ staggering heights so it looks like walking rather than glide\n        if (count % 2 === 0 ) { \/\/odd\n            image(srishtyImage, srishtyx - heightcount, 325, 66.2218, 205.4745); \n            srishtyx -= .3; \/\/ srishty walks to left\n\n        }\n        if (count % 2 === 1 ) { \/\/even\n            image(srishtyImage, srishtyx, 325 + heightcount, 66.2218, 205.4745); \n            srishtyx -= .3; \/\/ srishty walks to left\n\n        }\n    }\n\n}\n\nfunction drawCloud() { \/\/ draw cloud\n    image(cloudImage, cloudx, 69, 130.2123 , 46.6313 );\n    cloudx -= 0.09; \/\/cloud moves very slowly\n}\n\nfunction drawTandJ() { \/\/ tom and jerry frames chasing eachother\n\n        if (count &gt;= 0 & count <= 400 ) { \n            image(tomandjerry[tomandjerryitem], tomandjerryx, 300, 216.9349, 162.7012);\n            tomandjerryitem = 0\n        }\n\n        if (count &gt;= 400 & count <= 500) { \n            image(tomandjerry[tomandjerryitem], (tomandjerryx + 100) + tjdx, 300, 216.9349, 162.7012);\n            tomandjerryitem = 1\n            tjdx += .5\n        }\n\n        if (count &gt;= 500 & count <= 750) {\n            image(tomandjerry[tomandjerryitem], (tomandjerryx + 300) -tjdx, 400 - tjdy, 220, 120.7012);\n            tomandjerryitem = 2\n            tjdy += .5;\n            tjdx += .5\n        }\n        if (count &gt;= 750 & count <= 2000 ) { \n            image(tomandjerry[tomandjerryitem], (tomandjerryx + 200)-tjdx, 400 - tjdy, 216.9349\/2, 162.7012\/2); \n            tomandjerryitem = 3\n            tjdy += .5;\n            tjdx += 2;\n\n        }\n\n}\n \n\n\n<\/code><\/pre><\/p><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>I made a simple story about a girl (me) who goes on a walk to the park. During her time there as she walks by, she sees tom and jerry start chasing each other all over the park and she starts laughing. The background d elements and all elements other than tom and jerry were &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/2022\/11\/12\/srishtys-project-10\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Srishty&#8217;s Project 10&#8221;<\/span><\/a><\/p>\n","protected":false},"author":704,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[113,57,1],"tags":[131,61],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/75609"}],"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\/704"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/comments?post=75609"}],"version-history":[{"count":4,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/75609\/revisions"}],"predecessor-version":[{"id":75665,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/75609\/revisions\/75665"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/media?parent=75609"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/categories?post=75609"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/tags?post=75609"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}