{"id":815,"date":"2025-05-18T23:21:36","date_gmt":"2025-05-18T13:21:36","guid":{"rendered":"http:\/\/electricadventures.net\/?p=815"},"modified":"2025-05-18T23:21:36","modified_gmt":"2025-05-18T13:21:36","slug":"lets-make-a-retro-game-ep10-collision-detection","status":"publish","type":"post","link":"https:\/\/electricadventures.net\/?p=815","title":{"rendered":"Lets Make a Retro Game EP10: Collision Detection"},"content":{"rendered":"\n<p>In the Intellivision game of Astro Smash, which we are basing our game on, the main enemies are Asteroids that fall down the screen, exploding when they hit the ground.<\/p>\n\n\n\n<p>Points are awarded to the player when one is destroyed, and points are removed if one reaches the planet&#8217;s surface.<\/p>\n\n\n\n<p>In this episode, we are going to introduce collision detection, which will involve:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Adding a function that will determine if two objects have collided.<\/li>\n\n\n\n<li>Calling the function from inside our existing MOVE_ENEMIES routine.<\/li>\n<\/ul>\n\n\n\n<p>The supplied code has two folders, Start, where we start the episode and End, the final code and a copy of the ROM file.<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/tony-cruise\/ElectricAdventuresArchive\/blob\/main\/LMARG\/LMARG-EP10.zip\">Download Source Code<\/a>.<\/p>\n\n\n\n<p>The video associated with this episode is located\u00a0here:<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Lets Make A Retro Game - Episode 10 - Collision Detection\" width=\"960\" height=\"540\" src=\"https:\/\/www.youtube.com\/embed\/L0LI5Cm-ycg?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>The full article text is in the attached PDF document\u00a0<a href=\"https:\/\/github.com\/tony-cruise\/ElectricAdventuresArchive\/blob\/main\/LMARG\/LMARG-EP10-CollisionDetection.pdf\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the Intellivision game of Astro Smash, which we are basing our game on, the main enemies are Asteroids that fall down the screen, exploding when they hit the ground. Points are awarded to the player when one is destroyed, and points are removed if one reaches the planet&#8217;s surface. In this episode, we are<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[62],"tags":[],"class_list":["post-815","post","type-post","status-publish","format-standard","hentry","category-lets-make-a-retro-game"],"acf":[],"_links":{"self":[{"href":"https:\/\/electricadventures.net\/index.php?rest_route=\/wp\/v2\/posts\/815","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/electricadventures.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/electricadventures.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/electricadventures.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/electricadventures.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=815"}],"version-history":[{"count":1,"href":"https:\/\/electricadventures.net\/index.php?rest_route=\/wp\/v2\/posts\/815\/revisions"}],"predecessor-version":[{"id":816,"href":"https:\/\/electricadventures.net\/index.php?rest_route=\/wp\/v2\/posts\/815\/revisions\/816"}],"wp:attachment":[{"href":"https:\/\/electricadventures.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=815"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/electricadventures.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=815"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/electricadventures.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=815"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}