{"id":5954,"date":"2024-12-16T04:44:43","date_gmt":"2024-12-16T09:44:43","guid":{"rendered":"https:\/\/openlab.bmcc.cuny.edu\/mmp-210-fall-2024\/?p=5954"},"modified":"2024-12-16T04:44:48","modified_gmt":"2024-12-16T09:44:48","slug":"p5-js-blog-post-9","status":"publish","type":"post","link":"https:\/\/openlab.bmcc.cuny.edu\/mmp-210-fall-2024\/2024\/12\/16\/p5-js-blog-post-9\/","title":{"rendered":"p5.js blog post #9"},"content":{"rendered":"\n<p>The collisions in and of themselves were not the hard part, but figuring out how to remove the sprites from the canvas was difficult as there&#8217;s no easy way to remove preloaded images. I decided to make them slide out of the canvas, and it makes sense with the dead bodies (once I edit the sprite) but less sense with the blood bags.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"477\" src=\"https:\/\/openlab.bmcc.cuny.edu\/mmp-210-fall-2024\/wp-content\/uploads\/sites\/3895\/2024\/12\/image-19-1024x477.png\" alt=\"Setup function code and collision code. Shows dead body sprite in preview.\" class=\"wp-image-5959\" srcset=\"https:\/\/openlab.bmcc.cuny.edu\/mmp-210-fall-2024\/wp-content\/uploads\/sites\/3895\/2024\/12\/image-19-1024x477.png 1024w, https:\/\/openlab.bmcc.cuny.edu\/mmp-210-fall-2024\/wp-content\/uploads\/sites\/3895\/2024\/12\/image-19-300x140.png 300w, https:\/\/openlab.bmcc.cuny.edu\/mmp-210-fall-2024\/wp-content\/uploads\/sites\/3895\/2024\/12\/image-19-768x358.png 768w, https:\/\/openlab.bmcc.cuny.edu\/mmp-210-fall-2024\/wp-content\/uploads\/sites\/3895\/2024\/12\/image-19-1536x716.png 1536w, https:\/\/openlab.bmcc.cuny.edu\/mmp-210-fall-2024\/wp-content\/uploads\/sites\/3895\/2024\/12\/image-19-1568x731.png 1568w, https:\/\/openlab.bmcc.cuny.edu\/mmp-210-fall-2024\/wp-content\/uploads\/sites\/3895\/2024\/12\/image-19.png 1838w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1573\" height=\"836\" src=\"https:\/\/openlab.bmcc.cuny.edu\/mmp-210-fall-2024\/wp-content\/uploads\/sites\/3895\/2024\/12\/image-18-edited.png\" alt=\"Shows code for enemy object and the preview screen with the player, pick up item and enemy.\" class=\"wp-image-5957\" srcset=\"https:\/\/openlab.bmcc.cuny.edu\/mmp-210-fall-2024\/wp-content\/uploads\/sites\/3895\/2024\/12\/image-18-edited.png 1573w, https:\/\/openlab.bmcc.cuny.edu\/mmp-210-fall-2024\/wp-content\/uploads\/sites\/3895\/2024\/12\/image-18-edited-300x159.png 300w, https:\/\/openlab.bmcc.cuny.edu\/mmp-210-fall-2024\/wp-content\/uploads\/sites\/3895\/2024\/12\/image-18-edited-1024x544.png 1024w, https:\/\/openlab.bmcc.cuny.edu\/mmp-210-fall-2024\/wp-content\/uploads\/sites\/3895\/2024\/12\/image-18-edited-768x408.png 768w, https:\/\/openlab.bmcc.cuny.edu\/mmp-210-fall-2024\/wp-content\/uploads\/sites\/3895\/2024\/12\/image-18-edited-1536x816.png 1536w, https:\/\/openlab.bmcc.cuny.edu\/mmp-210-fall-2024\/wp-content\/uploads\/sites\/3895\/2024\/12\/image-18-edited-1568x833.png 1568w\" sizes=\"auto, (max-width: 1573px) 100vw, 1573px\" \/><\/figure>\n\n\n\n<p>Code: <a href=\"https:\/\/editor.p5js.org\/robbiery\/sketches\/by8eiuGLb\">https:\/\/editor.p5js.org\/robbiery\/sketches\/by8eiuGLb<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The collisions in and of themselves were not the hard part, but figuring out how to remove the sprites from the canvas was difficult as there&#8217;s no easy way to remove preloaded images. I decided to make them slide out of the canvas, and it makes sense with the dead bodies (once I edit the&hellip; <a class=\"more-link\" href=\"https:\/\/openlab.bmcc.cuny.edu\/mmp-210-fall-2024\/2024\/12\/16\/p5-js-blog-post-9\/\">Continue reading <span class=\"screen-reader-text\">p5.js blog post #9<\/span><\/a><\/p>\n","protected":false},"author":9834,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"portfolio_post_id":0,"portfolio_citation":"","portfolio_annotation":"","openlab_post_visibility":"","footnotes":""},"categories":[182],"tags":[],"coauthors":[172],"class_list":["post-5954","post","type-post","status-publish","format-standard","hentry","category-documentation","entry"],"_links":{"self":[{"href":"https:\/\/openlab.bmcc.cuny.edu\/mmp-210-fall-2024\/wp-json\/wp\/v2\/posts\/5954","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/openlab.bmcc.cuny.edu\/mmp-210-fall-2024\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/openlab.bmcc.cuny.edu\/mmp-210-fall-2024\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/openlab.bmcc.cuny.edu\/mmp-210-fall-2024\/wp-json\/wp\/v2\/users\/9834"}],"replies":[{"embeddable":true,"href":"https:\/\/openlab.bmcc.cuny.edu\/mmp-210-fall-2024\/wp-json\/wp\/v2\/comments?post=5954"}],"version-history":[{"count":3,"href":"https:\/\/openlab.bmcc.cuny.edu\/mmp-210-fall-2024\/wp-json\/wp\/v2\/posts\/5954\/revisions"}],"predecessor-version":[{"id":5960,"href":"https:\/\/openlab.bmcc.cuny.edu\/mmp-210-fall-2024\/wp-json\/wp\/v2\/posts\/5954\/revisions\/5960"}],"wp:attachment":[{"href":"https:\/\/openlab.bmcc.cuny.edu\/mmp-210-fall-2024\/wp-json\/wp\/v2\/media?parent=5954"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/openlab.bmcc.cuny.edu\/mmp-210-fall-2024\/wp-json\/wp\/v2\/categories?post=5954"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/openlab.bmcc.cuny.edu\/mmp-210-fall-2024\/wp-json\/wp\/v2\/tags?post=5954"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/openlab.bmcc.cuny.edu\/mmp-210-fall-2024\/wp-json\/wp\/v2\/coauthors?post=5954"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}