{"id":1403,"date":"2014-12-09T06:55:13","date_gmt":"2014-12-09T06:55:13","guid":{"rendered":"http:\/\/astoryisnotatree.net\/?p=1403"},"modified":"2020-04-29T21:01:16","modified_gmt":"2020-04-29T21:01:16","slug":"conference-post-3-a-cup-of-rain","status":"publish","type":"post","link":"https:\/\/astoryisnotatree.net\/?p=1403","title":{"rendered":"Games from Nothing: Post-Mortem \u2014 A Cup of Rain"},"content":{"rendered":"<p>In the making of &#8220;A Cup of Rain,&#8221; \u00a0I have run into several technical challenges.<\/p>\n<p>The first\u00a0was creating the collision effect among raindrops. Since these rain drops are called from an ArrayList, I did not know their specific coordinates to write the function. The most similar code in our class labs is the separation function in one of the\u00a0Flocking exercises \u00a0(NOC_6_07_Separation). \u00a0This function, however, is put into the class file because all the objects share the same radius, In my game, it is not the case, so getting the coordinates for each rain drops become a challenge.\u00a0At the end, I used several return functions in the class file to extract the x, y and radius, and this method is working.<\/p>\n<p>After getting the coordinates, the problem became how to compare the distance between object to create the colliding effect. Again, the problem is posed by the ArrayList because originally I thought there can only be one &#8220;for&#8221; loop and therefore the set of rain drops have nothing to compare with. I eventually found out that I can use a loop within a loop, which looks like this:<\/p>\n<p>for (Raindrop r1 : raindrops) {<br \/>\nfor (Raindrop r2 : raindrops) {<\/p>\n<p>This double loop solved my problem perfectly, and when those two problems were solved, others parts of the making process were much easier to deal with.<\/p>\n<p>As I mentioned in the previous post, \u00a0I imagined the game to have other playing mechanics \u00a0such as connecting and matching. For future improvement, I want to add this feature in, and perhaps also increase the diversity of the objects.<\/p>\n<p><a href=\"http:\/\/astoryisnotatree.net\/wp-content\/uploads\/2014\/12\/Screenshot_2014-12-09-00-19-55.jpeg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-1387\" src=\"http:\/\/astoryisnotatree.net\/wp-content\/uploads\/2014\/12\/Screenshot_2014-12-09-00-19-55-640x1024.jpeg\" alt=\"Screenshot_2014-12-09-00-19-55\" width=\"498\" height=\"797\" srcset=\"https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2014\/12\/Screenshot_2014-12-09-00-19-55-640x1024.jpeg 640w, https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2014\/12\/Screenshot_2014-12-09-00-19-55-187x300.jpeg 187w, https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2014\/12\/Screenshot_2014-12-09-00-19-55-624x998.jpeg 624w, https:\/\/astoryisnotatree.net\/wp-content\/uploads\/2014\/12\/Screenshot_2014-12-09-00-19-55.jpeg 1200w\" sizes=\"auto, (max-width: 498px) 100vw, 498px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the making of &#8220;A Cup of Rain,&#8221; \u00a0I have run into several technical challenges. The first\u00a0was creating the collision effect among raindrops. Since these rain drops are called from an ArrayList, I did not know their specific coordinates to&#8230;<\/p>\n","protected":false},"author":23,"featured_media":1387,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[39,103,50,53],"class_list":["post-1403","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-games-from-nothing","tag-conference-project","tag-conference-post-3","tag-conference","tag-post-mortem","wpcat-5-id"],"_links":{"self":[{"href":"https:\/\/astoryisnotatree.net\/index.php?rest_route=\/wp\/v2\/posts\/1403","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/astoryisnotatree.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/astoryisnotatree.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/astoryisnotatree.net\/index.php?rest_route=\/wp\/v2\/users\/23"}],"replies":[{"embeddable":true,"href":"https:\/\/astoryisnotatree.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1403"}],"version-history":[{"count":3,"href":"https:\/\/astoryisnotatree.net\/index.php?rest_route=\/wp\/v2\/posts\/1403\/revisions"}],"predecessor-version":[{"id":13842,"href":"https:\/\/astoryisnotatree.net\/index.php?rest_route=\/wp\/v2\/posts\/1403\/revisions\/13842"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/astoryisnotatree.net\/index.php?rest_route=\/wp\/v2\/media\/1387"}],"wp:attachment":[{"href":"https:\/\/astoryisnotatree.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1403"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/astoryisnotatree.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1403"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/astoryisnotatree.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1403"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}