jozanza [Lexaloffle Blog Feed] Egg Bros <p> <table><tr><td> <a href="/bbs/?pid=27233#p"> <img src="/bbs/thumbs/pico27232.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=27233#p"> Egg Bros 0.0.1</a><br><br> by <a href="/bbs/?uid=12073"> jozanza</a> <br><br><br> <a href="/bbs/?pid=27233#p"> [Click to Play]</a> </td></tr></table> </p> <p>A few months back, I started this cart and then basically abandoned it after I realized I was quickly approaching the token limit (~1500 left). There are a lot of ideas in this WIP, and it was a pretty good learning experience. I <em>almost</em> made a proper game in the process.</p> <p>If anyone thinks completion is worthwhile, I'd welcome suggestions for a purpose behind the gameplay. That was one thing I never really got around to! :3</p> Tue, 23 Aug 2016 00:52:08 UTC require() / code sharing / questions <p>The more projects I start, i've been finding it harder and harder to keep track of all my little copy-paste pico-8 code snippets. I've had a burning desire to use require(), so I could organize and reuse my code in modules, but there's no mechanism in pico-8 that let's you do this.</p> <p>It's also a bit manual and tedious to browse through and repurpose code in other people's carts since there's several steps involved.</p> <p>To try and solve these issues, I just published <a href="">a tool called p8</a>. It manages dependencies and makes it easy to share code across projects. It does so by injecting external dependencies into a cartridge and polyfilling a global require(), which allows you to import these modules from your project's entry point.</p> <p>Does anyone else have major problems with managing their code as their projects grow? How do you keep track of your snippets? What's your process for using code other people wrote?</p> Fri, 19 Aug 2016 02:40:23 UTC Testing PICO-8 Cartridges <p> <table><tr><td> <a href="/bbs/?pid=22080#p"> <img src="/bbs/thumbs/pico22079.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=22080#p"> pico-test manual 0.0.1</a><br><br> by <a href="/bbs/?uid=12073"> jozanza</a> <br><br><br> <a href="/bbs/?pid=22080#p"> [Click to Play]</a> </td></tr></table> </p> <p>Recently, I got really tired of writing buggy code with prinths scattered everywhere to try and figure out what the hell was going on. So, I created a way to test your carts while they run. It gives you output on the command line that looks something like this:</p> <img style="margin-bottom:16px" border=0 src="" alt="" /> <p>Hopefully, it's not too difficult to install/use. I mimicked <a href="">mocha</a>'s API at a high-level.</p> <p>I'd love to hear what you think if anyone decides to try it out. You can also download the cart and take a look at the code for more info. There's fairly detailed documentation on Github:</p> <p><strong><a href=""><a href=""></a></a></strong></p> <p>Also, feel free to comment on this thread with questions or hmu on twitter. Cheers!</p> Thu, 02 Jun 2016 02:05:21 UTC Compile moonscript to .p8 carts <p>I just came across moonscript the other day. It's a sort of coffeescript-esque language that compiles to Lua. It has a lot of nifty features -- including arrow functions, which is what sold me.</p> <p>So I wrote a tool that allows you to watch a .moon file and pipe it into the <strong>lua</strong> part of a .p8 cartridge. It's not thoroughly test and probably only works on OS X, but I've been personally enjoying writing moonscript in Sublime Text 3 and watching PICO-8 automatically reload on save :)</p> <p>I'll drop the link here in case anyone finds it useful or intriguing: <strong><a href="">PICOMOON</a></strong></p> <p>Cheers!</p> <img style="margin-bottom:16px" border=0 src="" alt="" /> Mon, 14 Mar 2016 03:26:08 UTC Persisting Game State <p>Hey guys, I'm just starting with PICO-8. So far it's very fun. Although I'm a frontend web developer by profession, Lua was very easy to pick up due to its similarities to Javascript. The development experience is generally pretty awesome apart from poor debugging tools. But overall, the simplicity is welcomed since it lets you bang out proof-of-concepts really quickly.</p> <p>Alas, the simplicity really does set me back in one category -- persisting data.</p> <p>It seems like looking at the manual and some carts, the main method is to write binary data to a memory address with peek/poke/memcpy/memset. As a JS guy, I've worked with plenty network protocols and IO between filesystems, databases, and APIs, but when it comes to working directly with binary data and using memory addresses, I'm kind of lost. I've rarely encountered a situation that required me to use bitwise operators or manipulate binary values directly.</p> <p>That being said, I have looked around the BBS and attempted to find something to guide me on this quest to save the game state. I've seen a couple of threads (<a href="">like this one</a>) and downloaded a few carts like Shodo and Picodachi to see how it's done. Despite my best attempts to grok the concept, it's very difficult to understand the following:</p> <p>1) Which memory addresses to use and how to prevent writing over previously written addresses. 0x5fc0-0x6000 seems like the sort of default range. But what are the intermediary addresses?</p> <p>2) Determining the proper number of bytes required to save an arbitrary number/string/boolean and determining how many to read back.</p> <p>3) How you'd go about using converting variables into binary before write and back again upon read.</p> <p>4) If there's a feasible way to convert and store functions or tables as well.</p> <p>I'd really appreciate any advice, tutorials, carts or code snippets that could help me wrap my head around how all this works in Picoland. Thanks! :)</p> Mon, 08 Feb 2016 02:26:03 UTC