{"id":931,"date":"2026-02-13T09:52:51","date_gmt":"2026-02-13T01:52:51","guid":{"rendered":"https:\/\/edu.circuspi.com\/?p=931"},"modified":"2026-03-09T16:28:49","modified_gmt":"2026-03-09T08:28:49","slug":"11-1-2-triggering-changes-power-ups","status":"publish","type":"post","link":"https:\/\/edu.circuspi.com\/index.php\/gamebit-en\/11-1-2-triggering-changes-power-ups\/","title":{"rendered":"11.1.2 Triggering Changes (Power-Ups)"},"content":{"rendered":"\n<p>We will use &#8220;eating a Burger&#8221; as the trigger to change the bullets. First, add a new Sprite of kind &#8220;<strong>Food<\/strong>&#8221; (the Burger) and adjust the distance between it and the player.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"474\" height=\"279\" src=\"https:\/\/edu.circuspi.com\/wp-content\/uploads\/2026\/02\/eng-11-1-2_01.png\" alt=\"\" class=\"wp-image-1283\"\/><\/figure>\n\n\n\n<p>Next, set up the &#8220;<strong>Overlap<\/strong>&#8221; event so the Burger disappears (with an effect) when touched.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"542\" height=\"172\" src=\"https:\/\/edu.circuspi.com\/wp-content\/uploads\/2026\/02\/eng-11-1-2_02.png\" alt=\"\" class=\"wp-image-1284\"\/><\/figure>\n\n\n\n<p>You are already familiar with the steps above. But what about the crucial &#8220;Change&#8221;? We can implement this using the &#8220;<strong>Variable<\/strong>&#8221; concept we mentioned before.<\/p>\n\n\n\n<p>First, inside &#8220;<strong>on start<\/strong>&#8220;, create a new variable and set an initial value. You can name the variable whatever you like, but a name that fits its purpose helps keep your logic clear. Since we are changing the bullet style to represent increased attack power, let&#8217;s name it &#8220;<strong>PowerUP<\/strong>&#8220;.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"481\" height=\"312\" src=\"https:\/\/edu.circuspi.com\/wp-content\/uploads\/2026\/02\/eng-11-1-2_03.png\" alt=\"\" class=\"wp-image-1285\"\/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>When the variable &#8220;<strong>PowerUP<\/strong>&#8221; is &#8220;<strong>0<\/strong>,&#8221; we want the bullet to be the original style.<\/li>\n\n\n\n<li>When it becomes &#8220;<strong>1<\/strong>,&#8221; we want the upgraded bullet style.<\/li>\n<\/ul>\n\n\n\n<p>So, at the end of the &#8220;Burger Eaten&#8221; block, add a block to <strong>set variable [PowerUP] to [1]<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"561\" height=\"195\" src=\"https:\/\/edu.circuspi.com\/wp-content\/uploads\/2026\/02\/eng-11-1-2_04.png\" alt=\"\" class=\"wp-image-1286\"\/><\/figure>\n\n\n\n<p>Finally, inside the &#8220;<strong>on [A] button [pressed]<\/strong>&#8221; block, add a logic condition (<strong>if&#8230; else&#8230;<\/strong>). Copy the bullet logic from the &#8220;B button&#8221; block into the appropriate slot.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"631\" height=\"287\" src=\"https:\/\/edu.circuspi.com\/wp-content\/uploads\/2026\/02\/eng-11-1-2_05.png\" alt=\"\" class=\"wp-image-1287\"\/><\/figure>\n\n\n\n<p>Since the &#8220;<strong>on [B] button [pressed]<\/strong>&#8221; block was just for testing our design, now that we have integrated the patterns into the &#8220;<strong>on [A] button [pressed]<\/strong>&#8221; block, you can delete the B button block.<\/p>\n\n\n\n<p>Please test in the <strong>Game Simulator<\/strong> to see if the bullets change.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"476\" height=\"382\" src=\"https:\/\/edu.circuspi.com\/wp-content\/uploads\/2026\/02\/eng-11-1-2_06.gif\" alt=\"\" class=\"wp-image-1288\"\/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>We will use &#8220;eating a Burger&#8221; as the trigge [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":510,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21,23],"tags":[],"table_tags":[],"class_list":{"0":"post-931","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\/931","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=931"}],"version-history":[{"count":2,"href":"https:\/\/edu.circuspi.com\/index.php\/wp-json\/wp\/v2\/posts\/931\/revisions"}],"predecessor-version":[{"id":1306,"href":"https:\/\/edu.circuspi.com\/index.php\/wp-json\/wp\/v2\/posts\/931\/revisions\/1306"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/edu.circuspi.com\/index.php\/wp-json\/wp\/v2\/media\/510"}],"wp:attachment":[{"href":"https:\/\/edu.circuspi.com\/index.php\/wp-json\/wp\/v2\/media?parent=931"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/edu.circuspi.com\/index.php\/wp-json\/wp\/v2\/categories?post=931"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/edu.circuspi.com\/index.php\/wp-json\/wp\/v2\/tags?post=931"},{"taxonomy":"table_tags","embeddable":true,"href":"https:\/\/edu.circuspi.com\/index.php\/wp-json\/wp\/v2\/table_tags?post=931"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}