{"id":108,"date":"2025-06-06T20:45:18","date_gmt":"2025-06-06T20:45:18","guid":{"rendered":"https:\/\/cyberwraith.rainydays-games.com\/?p=108"},"modified":"2025-06-06T20:45:18","modified_gmt":"2025-06-06T20:45:18","slug":"new-enemy-the-creeper","status":"publish","type":"post","link":"https:\/\/cyberwraith.rainydays-games.com\/?p=108","title":{"rendered":"New Enemy: the Creeper"},"content":{"rendered":"\n<p><em>Original date: June 11, 2022<\/em><\/p>\n\n\n\n<p>Finished a new enemy in today&#8217;s stream: the Creeper. This guy moves (&#8220;creeps&#8221;) along a wall and fires a constant laser beam. It&#8217;s more of a mix between an enemy and an obstacle. Currently thinking if I create maybe a stationary turret version of it that fires a more conventional weapon, maybe plasma bolts or something. Not sure yet, we&#8217;ll see.<\/p>\n\n\n\n<p>Have to admit, creating this one was a bit annoying. Normally the enemies constantly do a raycast at the player to know where the player&#8217;s ship is and when it&#8217;s close enough to attack. Creeper does so, too, but it kept switching between aggro and not aggro because in like 90% of cases the raycast hit the wall instead of the player. Quite obvious in the end. Unless otherwise specified, the raycast starts at the caster&#8217;s origin. Not going to work well if the origin is within a wall. Still surprised some of them came through.<\/p>\n\n\n\n<p>Also had the issue that I check the Creeper&#8217;s orientation to know in which directions it moves. For example, if it&#8217;s at 0\u00b0, it points upward and moves left to right. If it&#8217;s at 90\u00b0, it points to the right and moves up and down. The former worked, the latter didn&#8217;t, the check never became true. Turns out: in the inspector, the Creeper&#8217;s rotation was set at 90\u00b0. However, a quick print(rotation_degrees) revealed: in-game the rotation was at something like 89.97763\u00b0. Little bastard!<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-vimeo wp-block-embed-vimeo wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Creepers\" src=\"https:\/\/player.vimeo.com\/video\/1091317060?dnt=1&amp;app_id=122963\" width=\"676\" height=\"380\" frameborder=\"0\" allow=\"autoplay; fullscreen; picture-in-picture; clipboard-write; encrypted-media\"><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Original date: June 11, 2022 Finished a new enemy in today&#8217;s stream: the Creeper. This guy moves (&#8220;creeps&#8221;) along a wall and fires a constant laser beam. It&#8217;s more of a mix between an enemy and an obstacle. Currently thinking if I create maybe a stationary turret version of it that fires a more conventional [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-108","post","type-post","status-publish","format-standard","hentry","category-uncategorized","post-preview"],"_links":{"self":[{"href":"https:\/\/cyberwraith.rainydays-games.com\/index.php?rest_route=\/wp\/v2\/posts\/108","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cyberwraith.rainydays-games.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cyberwraith.rainydays-games.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cyberwraith.rainydays-games.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cyberwraith.rainydays-games.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=108"}],"version-history":[{"count":1,"href":"https:\/\/cyberwraith.rainydays-games.com\/index.php?rest_route=\/wp\/v2\/posts\/108\/revisions"}],"predecessor-version":[{"id":109,"href":"https:\/\/cyberwraith.rainydays-games.com\/index.php?rest_route=\/wp\/v2\/posts\/108\/revisions\/109"}],"wp:attachment":[{"href":"https:\/\/cyberwraith.rainydays-games.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=108"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cyberwraith.rainydays-games.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=108"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cyberwraith.rainydays-games.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=108"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}