{"id":516,"date":"2012-11-12T15:03:34","date_gmt":"2012-11-12T15:03:34","guid":{"rendered":"http:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/?p=516"},"modified":"2012-11-12T15:03:34","modified_gmt":"2012-11-12T15:03:34","slug":"project-1-part-1","status":"publish","type":"post","link":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/2012\/11\/12\/project-1-part-1\/","title":{"rendered":"Project 1 &#8211; Part 1"},"content":{"rendered":"<p>This is just the rain falling down the screen. It does a weird bunching thing at the beginning where more will fall than usual, but that makes sense with the use of arrays and it trying to have the same number of drops on screen at all times. It&#8217;s just here to look pretty, so it doesn&#8217;t do anything really special.<\/p>\n<p><script type=\"application\/processing\">\r\nPImage pic;\r\nRain r1;\r\n\r\nint numDrops = 200;\r\nRain[] drops = new Rain[numDrops];\r\n\r\nvoid setup(){\r\n  size (463,327);\r\n  pic = loadImage (\"http:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-content\/uploads\/2012\/11\/Ocean1.jpg\");\r\n  \r\n  \r\n  for (int i=0; i < drops.length; i++){\r\n    drops[i] = new Rain();\r\n    r1 = new Rain();\r\n  }\r\n}\r\n\r\nvoid draw(){\r\n  background (pic);\r\n  for (int i=0; i< drops.length; i++){\r\n    drops[i].fall();\r\n  }\r\n}\r\n\r\nclass Rain {\r\n  float r = random(width);\r\n  float y = random(-height);\r\n  \r\n  void fall(){\r\n    y = y + 10;\r\n    fill(176,196,222,90);\r\n    stroke(78,78,78,90);\r\n    rect(r,y,3,10);\r\n    \r\n    if(y>height){\r\n      r=random(463);\r\n      y=random(-327);\r\n    }\r\n  }\r\n}\r\n<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is just the rain falling down the screen. It does a weird bunching thing at the beginning where more will fall than usual, but that makes sense with the use of arrays and it trying to have the same &hellip; <a href=\"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/2012\/11\/12\/project-1-part-1\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/posts\/516"}],"collection":[{"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/comments?post=516"}],"version-history":[{"count":1,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/posts\/516\/revisions"}],"predecessor-version":[{"id":519,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/posts\/516\/revisions\/519"}],"wp:attachment":[{"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/media?parent=516"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/categories?post=516"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/IMGD3x00_B12\/wp-json\/wp\/v2\/tags?post=516"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}