{"id":351,"date":"2018-05-10T20:52:25","date_gmt":"2018-05-10T20:52:25","guid":{"rendered":"https:\/\/projects-old.etc.cmu.edu\/alice-adventure\/?page_id=351"},"modified":"2018-05-10T23:01:52","modified_gmt":"2018-05-10T23:01:52","slug":"what-is-a-state-and-how-do-you-use-it","status":"publish","type":"page","link":"https:\/\/projects-old.etc.cmu.edu\/alice-adventure\/index.php\/what-is-a-state-and-how-do-you-use-it\/","title":{"rendered":"What is a state and how do you use it?"},"content":{"rendered":"<p>In Alice&#8217;s Adventure, a state is essentially a boolean, or a switch which can be flipped to be either &#8216;ON&#8217; or &#8216;OFF&#8217;<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-371\" src=\"https:\/\/projects-old.etc.cmu.edu\/alice-adventure\/wp-content\/uploads\/2018\/05\/Capture-8.png\" alt=\"\" width=\"236\" height=\"123\" \/>here the state is at &#8216;OFF&#8217; position<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-372\" src=\"https:\/\/projects-old.etc.cmu.edu\/alice-adventure\/wp-content\/uploads\/2018\/05\/Capture2.png\" alt=\"\" width=\"235\" height=\"127\" \/>and here the state is at &#8216;ON&#8217; position<\/p>\n<p>It is easy to switch between ON and OFF position at any time while making your game. All your states are under the State tab in the right side of your screen, where you know which one&#8217;s are at ON and which one&#8217;s are at OFF.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-373\" src=\"https:\/\/projects-old.etc.cmu.edu\/alice-adventure\/wp-content\/uploads\/2018\/05\/Capture-9.png\" alt=\"\" width=\"223\" height=\"212\" \/><\/p>\n<p>Now these states can be <em>used as a condition<\/em>. For example, if you had a &#8216;fridge&#8217; which you clicked on to show an object &#8216;milk&#8217;, it will occur freely.<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-374\" src=\"https:\/\/projects-old.etc.cmu.edu\/alice-adventure\/wp-content\/uploads\/2018\/05\/Capture-10-217x300.png\" alt=\"\" width=\"217\" height=\"300\" srcset=\"https:\/\/projects-old.etc.cmu.edu\/alice-adventure\/wp-content\/uploads\/2018\/05\/Capture-10-217x300.png 217w, https:\/\/projects-old.etc.cmu.edu\/alice-adventure\/wp-content\/uploads\/2018\/05\/Capture-10.png 274w\" sizes=\"(max-width: 217px) 100vw, 217px\" \/><\/p>\n<p>Now if you wanted it to work in such a way that milk is shown only when your state has been turned to ON, then you could do this:<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-375\" src=\"https:\/\/projects-old.etc.cmu.edu\/alice-adventure\/wp-content\/uploads\/2018\/05\/Capture-11-300x256.png\" alt=\"\" width=\"300\" height=\"256\" srcset=\"https:\/\/projects-old.etc.cmu.edu\/alice-adventure\/wp-content\/uploads\/2018\/05\/Capture-11-300x256.png 300w, https:\/\/projects-old.etc.cmu.edu\/alice-adventure\/wp-content\/uploads\/2018\/05\/Capture-11.png 514w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>So as you can see here, &#8220;My State&#8221; is OFF right now. So if you run the game and click on the fridge, it will check if &#8220;My State&#8221; is ON right now. Since it is not, the reaction won&#8217;t work and you won&#8217;t get the milk.<\/p>\n<p>Let&#8217;s find a way to switch ON the &#8220;My State&#8221; while in the game.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-376 size-full\" src=\"https:\/\/projects-old.etc.cmu.edu\/alice-adventure\/wp-content\/uploads\/2018\/05\/Capture-12.png\" alt=\"\" width=\"523\" height=\"790\" srcset=\"https:\/\/projects-old.etc.cmu.edu\/alice-adventure\/wp-content\/uploads\/2018\/05\/Capture-12.png 523w, https:\/\/projects-old.etc.cmu.edu\/alice-adventure\/wp-content\/uploads\/2018\/05\/Capture-12-199x300.png 199w\" sizes=\"(max-width: 523px) 100vw, 523px\" \/><\/p>\n<p>Now here, if you notice the second interaction box, you will see that if you click on the door, you can set the state &#8220;My State&#8221; to ON.<\/p>\n<p>This essentially means that while in the game,\u00a0<strong>Only if you click on the door first will you be allowed to take milk from the fridge.<\/strong> Conditions like this can be achieved by using states. Talk to your teacher to find more about states and how well you can use it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In Alice&#8217;s Adventure, a state is essentially a boolean, or a switch which can be flipped to be either &#8216;ON&#8217; or &#8216;OFF&#8217; here the state is at &#8216;OFF&#8217; position and here the state is at &#8216;ON&#8217; position It is easy to switch between ON and OFF position at any time while making your game. All &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/projects-old.etc.cmu.edu\/alice-adventure\/index.php\/what-is-a-state-and-how-do-you-use-it\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;What is a state and how do you use it?&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-351","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/projects-old.etc.cmu.edu\/alice-adventure\/index.php\/wp-json\/wp\/v2\/pages\/351"}],"collection":[{"href":"https:\/\/projects-old.etc.cmu.edu\/alice-adventure\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/projects-old.etc.cmu.edu\/alice-adventure\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/projects-old.etc.cmu.edu\/alice-adventure\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/projects-old.etc.cmu.edu\/alice-adventure\/index.php\/wp-json\/wp\/v2\/comments?post=351"}],"version-history":[{"count":3,"href":"https:\/\/projects-old.etc.cmu.edu\/alice-adventure\/index.php\/wp-json\/wp\/v2\/pages\/351\/revisions"}],"predecessor-version":[{"id":377,"href":"https:\/\/projects-old.etc.cmu.edu\/alice-adventure\/index.php\/wp-json\/wp\/v2\/pages\/351\/revisions\/377"}],"wp:attachment":[{"href":"https:\/\/projects-old.etc.cmu.edu\/alice-adventure\/index.php\/wp-json\/wp\/v2\/media?parent=351"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}