{"id":907,"date":"2026-02-13T09:28:35","date_gmt":"2026-02-13T01:28:35","guid":{"rendered":"https:\/\/edu.circuspi.com\/?p=907"},"modified":"2026-03-09T16:06:31","modified_gmt":"2026-03-09T08:06:31","slug":"9-4-1-chasing-the-player","status":"publish","type":"post","link":"https:\/\/edu.circuspi.com\/index.php\/gamebit-en\/9-4-1-chasing-the-player\/","title":{"rendered":"9.4.1 Chasing the Player"},"content":{"rendered":"\n<p>Before we explain, you might have thought: &#8220;Since it needs to chase the player, do we need to know the &#8216;Player&#8217;s coordinates&#8217; and the &#8216;Enemy&#8217;s coordinates,&#8217; calculate the angle of the shortest distance, and then pursue?&#8221;<\/p>\n\n\n\n<p>No, no, no. While theoretically correct, practical operation doesn&#8217;t need to be that complex. MakeCode Arcade has already figured it out for us.<\/p>\n\n\n\n<p>Let&#8217;s click on &#8220;<strong>Sprites<\/strong>.&#8221; Inside the &#8220;<strong>Physics<\/strong>&#8221; section of the list, you can find the &#8220;<strong>set [myEnemy] follow [mySprite]<\/strong>&#8221; block.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"702\" height=\"358\" src=\"https:\/\/edu.circuspi.com\/wp-content\/uploads\/2026\/02\/eng-09-4-1_01.png\" alt=\"\" class=\"wp-image-1238\"\/><\/figure>\n\n\n\n<p>Drag this block into &#8220;<strong>on start<\/strong>.&#8221; Click the &#8220;<strong>+<\/strong>&#8221; sign at the end of the block to see the &#8220;<strong>Speed<\/strong>&#8221; setting field. The default speed of 100 makes the enemy as fast as the player\u2014playing at this speed is extremely difficult! You&#8217;ll be caught in the blink of an eye. So, please change it to a lower number.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"496\" height=\"295\" src=\"https:\/\/edu.circuspi.com\/wp-content\/uploads\/2026\/02\/eng-09-4-1_02.png\" alt=\"\" class=\"wp-image-1239\"\/><\/figure>\n\n\n\n<p>After setting it, test it with the <strong>Game Simulator<\/strong> and repeatedly adjust it to a speed you feel is appropriate.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"404\" height=\"546\" src=\"https:\/\/edu.circuspi.com\/wp-content\/uploads\/2026\/02\/eng-09-4-1_03.gif\" alt=\"\" class=\"wp-image-1240\"\/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Before we explain, you might have thought: &#8220;Since [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":458,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21,23],"tags":[],"table_tags":[],"class_list":{"0":"post-907","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-gamebit-en","8":"category-freeinfo-en","9":"czr-hentry"},"_links":{"self":[{"href":"https:\/\/edu.circuspi.com\/index.php\/wp-json\/wp\/v2\/posts\/907","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/edu.circuspi.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/edu.circuspi.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/edu.circuspi.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/edu.circuspi.com\/index.php\/wp-json\/wp\/v2\/comments?post=907"}],"version-history":[{"count":2,"href":"https:\/\/edu.circuspi.com\/index.php\/wp-json\/wp\/v2\/posts\/907\/revisions"}],"predecessor-version":[{"id":1250,"href":"https:\/\/edu.circuspi.com\/index.php\/wp-json\/wp\/v2\/posts\/907\/revisions\/1250"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/edu.circuspi.com\/index.php\/wp-json\/wp\/v2\/media\/458"}],"wp:attachment":[{"href":"https:\/\/edu.circuspi.com\/index.php\/wp-json\/wp\/v2\/media?parent=907"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/edu.circuspi.com\/index.php\/wp-json\/wp\/v2\/categories?post=907"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/edu.circuspi.com\/index.php\/wp-json\/wp\/v2\/tags?post=907"},{"taxonomy":"table_tags","embeddable":true,"href":"https:\/\/edu.circuspi.com\/index.php\/wp-json\/wp\/v2\/table_tags?post=907"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}