zlg [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=14922 Closure-powered game state demo <p> <table><tr><td> <a href="/bbs/?pid=67004#p"> <img src="/bbs/thumbs/pico8_jajewugupa-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=67004#p"> Closure State Demo v0.01</a><br><br> by <a href="/bbs/?uid=14922"> zlg</a> <br><br><br> <a href="/bbs/?pid=67004#p"> [Click to Play]</a> </td></tr></table> </p> <p>A little while ago, I got some help in making state switching easy to understand and carry out without (too) many issues. Since I've been trying to get back into the swing of things, I decided to begin documenting the things I learn and turning them into proof-of-concept demos. My hope is to be able to come back to the code and understand why it was useful to me.</p> <p>The eventual goal is to build and/or showcase some code that makes building PICO-8 games easy and fun for me.</p> <p>The Closure State Demo is simple:</p> <ul> <li>There are two states: ring, and FOE (kudos to those who get the reference)</li> <li>You swap between the states using X</li> <li>The same variable name is used (&quot;message&quot;) to display different text in each of the game states</li> <li>The FOE starts in the same place every time you begin its phase</li> </ul> <p>I threw in a few extras, like movement and bounds-checking for the FOE sprite so it feels a little more &quot;real&quot;.</p> <p>More detailed notes are contained in the cartridge's comments. Let me know if it makes sense or is useful for you!</p> https://www.lexaloffle.com/bbs/?tid=35198 https://www.lexaloffle.com/bbs/?tid=35198 Thu, 29 Aug 2019 04:20:34 UTC