{"id":888,"date":"2026-02-13T09:06:43","date_gmt":"2026-02-13T01:06:43","guid":{"rendered":"https:\/\/edu.circuspi.com\/?p=888"},"modified":"2026-03-09T15:46:46","modified_gmt":"2026-03-09T07:46:46","slug":"7-4-sprite-overlaps","status":"publish","type":"post","link":"https:\/\/edu.circuspi.com\/index.php\/gamebit-en\/7-4-sprite-overlaps\/","title":{"rendered":"7.4 Sprite Overlaps"},"content":{"rendered":"\n<p>If we want the &#8220;<strong>Orange Dinosaur<\/strong>&#8221; to eat the &#8220;<strong>Burger<\/strong>&#8220;\u2014meaning the Burger disappears when the Dinosaur &#8220;<strong>collides<\/strong>&#8221; with it\u2014we need to use the concept of &#8220;<strong>Overlaps<\/strong>.&#8221; This allows us to program subsequent events when the images of two sprites overlap.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"950\" height=\"762\" src=\"https:\/\/edu.circuspi.com\/wp-content\/uploads\/2026\/02\/eng-07-3_04.gif\" alt=\"\" class=\"wp-image-1177\"\/><\/figure>\n\n\n\n<p>Please click on &#8220;<strong>Sprites<\/strong>&#8221; in the <strong>Block Toolbox<\/strong>, scroll down to find blocks related to &#8220;<strong>Overlaps<\/strong>,&#8221; and drag out the first block: &#8220;<strong>on sprite of kind (Player) overlaps otherSprite of kind (Player)<\/strong>.&#8221;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"756\" height=\"273\" src=\"https:\/\/edu.circuspi.com\/wp-content\/uploads\/2026\/02\/eng-07-3_05.png\" alt=\"\" class=\"wp-image-1178\"\/><\/figure>\n\n\n\n<p>Place this block in the <strong>Workspace<\/strong> (empty area). Since this block functions similarly to &#8220;<strong>on start<\/strong>&#8221; (it is an event handler), it cannot be placed inside other blocks, but you can place other blocks inside it.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"890\" height=\"642\" src=\"https:\/\/edu.circuspi.com\/wp-content\/uploads\/2026\/02\/eng-07-3_06.png\" alt=\"\" class=\"wp-image-1179\"\/><\/figure>\n\n\n\n<p>Let&#8217;s look closely at this block. It states that when a certain Kind &#8220;<strong>overlaps<\/strong>&#8221; with another Kind, it triggers the blocks inside it.<\/p>\n\n\n\n<p>So, if we want the Burger to &#8220;<strong>disappear<\/strong>&#8221; when the &#8220;<strong>Orange Dinosaur<\/strong>&#8221; overlaps with the &#8220;<strong>Burger<\/strong>,&#8221; we can place the &#8220;<strong>destroy<\/strong>&#8221; block inside.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"933\" height=\"498\" src=\"https:\/\/edu.circuspi.com\/wp-content\/uploads\/2026\/02\/eng-07-3_07.png\" alt=\"\" class=\"wp-image-1180\"\/><\/figure>\n\n\n\n<p>Making a specific sprite disappear is easy. In the &#8220;<strong>Sprites<\/strong>&#8221; list, there is a &#8220;<strong>destroy [mySprite]<\/strong>&#8221; block. This block will help us make the Burger vanish.<\/p>\n\n\n\n<p><strong>Crucial Step:<\/strong> We need to change the logic in the overlap block to: &#8220;<strong>on sprite of kind (Player) overlaps otherSprite of kind (Food)<\/strong>.&#8221;<\/p>\n\n\n\n<p>Then, inside the block, drag the &#8220;<strong>otherSprite<\/strong>&#8221; value (the red rounded block representing the specific Food that was hit) into the destroy block.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"757\" height=\"479\" src=\"https:\/\/edu.circuspi.com\/wp-content\/uploads\/2026\/02\/eng-07-3_08.png\" alt=\"\" class=\"wp-image-1181\"\/><\/figure>\n\n\n\n<p>Or, ensure you select the correct variable name for the burger; otherwise, nothing will happen!<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"835\" height=\"219\" src=\"https:\/\/edu.circuspi.com\/wp-content\/uploads\/2026\/02\/eng-07-3_09.png\" alt=\"\" class=\"wp-image-1182\"\/><\/figure>\n\n\n\n<p>Once finished, run it in the <strong>Game Simulator<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"964\" height=\"800\" src=\"https:\/\/edu.circuspi.com\/wp-content\/uploads\/2026\/02\/eng-07-3_10.gif\" alt=\"\" class=\"wp-image-1183\"\/><\/figure>\n\n\n\n<p>The &#8220;<strong>destroy [mySprite]<\/strong>&#8221; block also allows you to adjust the special effect upon destruction. Click the &#8220;<strong>+<\/strong>&#8221; symbol at the end of the block to select an &#8220;<strong>effect<\/strong>&#8221; (like fire, spray) and adjust the &#8220;<strong>duration<\/strong>.&#8221;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"903\" height=\"395\" src=\"https:\/\/edu.circuspi.com\/wp-content\/uploads\/2026\/02\/eng-07-3_10.png\" alt=\"\" class=\"wp-image-1184\"\/><\/figure>\n\n\n\n<p>Test it again in the <strong>Game Simulator<\/strong>, try switching between different effects, and find the one you like best! (*\u00b4\u2200`)~\u2665<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"782\" height=\"636\" src=\"https:\/\/edu.circuspi.com\/wp-content\/uploads\/2026\/02\/eng-07-3_12.gif\" alt=\"\" class=\"wp-image-1185\"\/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>If we want the &#8220;Orange Dinosaur&#8221; to eat the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":394,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21,23],"tags":[],"table_tags":[],"class_list":{"0":"post-888","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\/888","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=888"}],"version-history":[{"count":2,"href":"https:\/\/edu.circuspi.com\/index.php\/wp-json\/wp\/v2\/posts\/888\/revisions"}],"predecessor-version":[{"id":1190,"href":"https:\/\/edu.circuspi.com\/index.php\/wp-json\/wp\/v2\/posts\/888\/revisions\/1190"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/edu.circuspi.com\/index.php\/wp-json\/wp\/v2\/media\/394"}],"wp:attachment":[{"href":"https:\/\/edu.circuspi.com\/index.php\/wp-json\/wp\/v2\/media?parent=888"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/edu.circuspi.com\/index.php\/wp-json\/wp\/v2\/categories?post=888"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/edu.circuspi.com\/index.php\/wp-json\/wp\/v2\/tags?post=888"},{"taxonomy":"table_tags","embeddable":true,"href":"https:\/\/edu.circuspi.com\/index.php\/wp-json\/wp\/v2\/table_tags?post=888"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}