tmountain [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=25569 Building PICO-8 games in TypeScript <p>Hi,</p> <p>I'm writing to announce <a href="https://github.com/tmountain/pico-8-typescript">tspico8</a>, a project which allows you to create PICO-8 games using TypeScript. For anyone unfamiliar with TypeScript, it's a superset of JavaScript, and it allows you to annotate your code with static type declarations so that the compiler can find a lot of errors for you.</p> <p>Some of the benefits include:</p> <ul> <li>Write PICO-8 games in a powerful language with a lot of builtin safety</li> <li>Take advantage of tooling to improve code quality (linting, formatting, etc)</li> <li>Minify code automatically to reduce token size (multiple configuration options)</li> <li>Utilize an external spritesheet if you want to (make sprites with aseprite, etc)</li> </ul> <p>For anyone that's curious, the technical details of how this works are as follows:</p> <ul> <li>TypeScript is compiled to JavaScript</li> <li>JavaScript is minified (compressed and mangled)</li> <li>Minified JavaScript is transpiled to PICO-8 compatible Lua</li> <li>Everything is packaged into a cart (code &amp; spritesheet)</li> </ul> <p>PICO-8 reloads automatically on every build to save you time.</p> <p>Check out the project if you're interested, and let me know what you think. Thanks!</p> <p><a href="https://github.com/tmountain/pico-8-typescript">TSPico8 project on Github</a></p> https://www.lexaloffle.com/bbs/?tid=48095 https://www.lexaloffle.com/bbs/?tid=48095 Thu, 09 Jun 2022 17:59:16 UTC Conway's Game of Life <p> <table><tr><td> <a href="/bbs/?pid=83226#p"> <img src="/bbs/thumbs/pico8_conwaylife-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=83226#p"> conwaylife</a><br><br> by <a href="/bbs/?uid=25569"> tmountain</a> <br><br><br> <a href="/bbs/?pid=83226#p"> [Click to Play]</a> </td></tr></table> </p> <p>Here's a pretty minimal implementation of Conway's Game of Life for PICO-8. It has a basic performance optimization (it only updates the active area of the grid), and you can see the active area adjust by setting dbg=true at the top of the code.</p> <p>That said, it gets pretty slow pretty quickly for larger simulations.</p> <p>You set up the grid as follows:</p> <p>Arrow keys -- move the cursor around.<br /> Z key -- toggle a given cell to active/inactive.<br /> X key -- start / stop the simulation.</p> <p>If you're unfamiliar with the Game of Life, google it :-).<br /> An easy starting point for a cool pattern is a ten cell contiguous row (10 connected horizontal cells).</p> <p>There are better PICO-8 Game of Life carts, but I had a lot of fun making this.</p> <p>Enjoy!</p> https://www.lexaloffle.com/bbs/?tid=40002 https://www.lexaloffle.com/bbs/?tid=40002 Thu, 22 Oct 2020 21:02:26 UTC Mandelbrot (Demo) <p> <table><tr><td> <a href="/bbs/?pid=43870#p"> <img src="/bbs/thumbs/pico43869.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=43870#p"> Mandlebrot (Demo)</a><br><br> by <a href="/bbs/?uid=25569"> tmountain</a> <br><br><br> <a href="/bbs/?pid=43870#p"> [Click to Play]</a> </td></tr></table> </p> <p>Mandlebrot fractal renderer with random color cycling.</p> https://www.lexaloffle.com/bbs/?tid=29885 https://www.lexaloffle.com/bbs/?tid=29885 Sat, 02 Sep 2017 14:25:27 UTC Pendulum (Demo) <p> <table><tr><td> <a href="/bbs/?pid=43867#p"> <img src="/bbs/thumbs/pico43873.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=43867#p"> Pendulum</a><br><br> by <a href="/bbs/?uid=25569"> tmountain</a> <br><br><br> <a href="/bbs/?pid=43867#p"> [Click to Play]</a> </td></tr></table> </p> <p>Simple demo of pendulum physics.</p> https://www.lexaloffle.com/bbs/?tid=29884 https://www.lexaloffle.com/bbs/?tid=29884 Sat, 02 Sep 2017 14:10:42 UTC