2darray [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=16330 Tiny Swordfighter <p> <table><tr><td> <a href="/bbs/?pid=60506#p"> <img src="/bbs/thumbs/pico8_tiny_swordfighter-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=60506#p"> tiny_swordfighter</a><br><br> by <a href="/bbs/?uid=16330"> 2darray</a> <br><br><br> <a href="/bbs/?pid=60506#p"> [Click to Play]</a> </td></tr></table> </p> <p>Tiny Swordfighter is a swordfighting game, and it's pretty tiny, but it's got some fun features:</p> <ul> <li>Swords</li> <li>Guns</li> <li>Bump-mapped lighting</li> <li>Flowfield pathfinding (solves shared paths for many enemies at once)</li> <li>Auto-save</li> <li>A bossfight at the end</li> </ul> <p>It's pretty close to finished, but I figured I'd try doing a WIP post to get some feedback for final adjustments. I'm nearly out of tokens, but there's still some room to optimize some more out, so I can do a small amount of extra stuff. I know it still needs some sound effects and a bossfight song, but other than that, let me know if you find any problems - confusing stuff, frustrating stuff, broken stuff, tedious stuff, etc.</p> https://www.lexaloffle.com/bbs/?tid=32766 https://www.lexaloffle.com/bbs/?tid=32766 Wed, 02 Jan 2019 19:20:24 UTC Advent Calendar 2018 <p> <table><tr><td> <a href="/bbs/?pid=59497#p"> <img src="/bbs/thumbs/pico8_pico8adventcalendar2018-31.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=59497#p"> pico8adventcalendar2018</a><br><br> by <a href="/bbs/?uid=16330"> 2darray</a> <br><br><br> <a href="/bbs/?pid=59497#p"> [Click to Play]</a> </td></tr></table> </p> <h3>It's the Pico-8 Advent Calendar for 2018!</h3> <p>This is the main menu for a collaboration organized by Bigaston.</p> <p>Come back on each day from the 1st to the 25th of December for twenty-five different surprises, each made by a different developer! This menu cartridge will link to all of the games as they are released, though the individual cartridges will also have their own threads.</p> https://www.lexaloffle.com/bbs/?tid=32388 https://www.lexaloffle.com/bbs/?tid=32388 Sat, 01 Dec 2018 04:12:45 UTC Froggy Road <p> <table><tr><td> <a href="/bbs/?pid=59052#p"> <img src="/bbs/thumbs/pico59051.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=59052#p"> Froggy Road (TweetTweetJam Entry)</a><br><br> by <a href="/bbs/?uid=16330"> 2darray</a> <br><br><br> <a href="/bbs/?pid=59052#p"> [Click to Play]</a> </td></tr></table> </p> <p>An entry for <a href="https://itch.io/jam/tweettweetjam">TweetTweetJam</a> - a weeklong gamejam where everyone makes a game in 560 bytes or less.</p> <p>Arrow keys to move, X to reset if you die. Your score is based on your forward distance.</p> https://www.lexaloffle.com/bbs/?tid=32256 https://www.lexaloffle.com/bbs/?tid=32256 Thu, 15 Nov 2018 23:44:55 UTC Winter Golf <p> <table><tr><td> <a href="/bbs/?pid=57221#p"> <img src="/bbs/thumbs/pico8_winter_golf_2darray-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=57221#p"> winter_golf_2darray</a><br><br> by <a href="/bbs/?uid=16330"> 2darray</a> <br><br><br> <a href="/bbs/?pid=57221#p"> [Click to Play]</a> </td></tr></table> </p> <p>This is my entry in the Pico-8 Advent Calendar for 2018, a jam organized by Bigaston.</p> <p>Winter Golf is a short golf game for snowy-minded individuals. Each time you collect a snowflake, your snowball gets larger and larger. Grab all the snowflakes in a course to unlock the goal! There are five courses total.</p> <p>Press left and right to aim, hold and release O (or, on a keyboard, Z) to take a shot, or hold X to restart the current course.</p> <p>There's a special surprise at the end...but you'll have to figure out how to get to it!</p> <p>(little note: this thread originally contained a placeholder cartridge, so there are some comments about that original cart - for context, it was a drawing of an orange.)</p> https://www.lexaloffle.com/bbs/?tid=31956 https://www.lexaloffle.com/bbs/?tid=31956 Fri, 28 Sep 2018 13:32:19 UTC Tiny Fisher <p> <table><tr><td> <a href="/bbs/?pid=51637#p"> <img src="/bbs/thumbs/pico51642.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=51637#p"> Tiny Fisher</a><br><br> by <a href="/bbs/?uid=16330"> 2darray</a> <br><br><br> <a href="/bbs/?pid=51637#p"> [Click to Play]</a> </td></tr></table> </p> <p>Ahoy! Here's a little fishing game for you.</p> <p>The main goal of this project was to experiment with a bunch of fun rendering effects that aren't super common in Pico-8...</p> <p>...so hopefully the gameplay is worthwhile enough to justify its own inclusion.</p> <p>Some features:</p> <ul> <li>3D character animation (with knees and elbows!)</li> <li>Spriteless animated fish rendering</li> <li>Water which visualizes a flow-velocity field</li> <li>Fullscreen &quot;day to night&quot; transition filter</li> <li>Realtime shadows, including soft shadows from the player</li> <li>&quot;Windy grass&quot; rendering</li> <li>Procedurally generated maps</li> <li>A shop with four gadgets</li> <li>Something unexpected, which I don't want to spoil for you</li> </ul> <p>The version of the code that's included here is obfuscated to be illegible, but you can buy the real source code (formatted properly, with optional comments) on <a href="https://2darray.itch.io/tiny-fisher">itch.io</a> - the price is &quot;$1 or more.&quot;</p> <p>Thanks for reading - I hope you enjoy the game!</p> <hr /> <p><em>First update - fixed a bug in the minified version which broke all the item unlocks. Sorry about that!</em></p> <p><em>Second update - didn't change the game, but the itch.io page is live, so I added a link above.</em></p> https://www.lexaloffle.com/bbs/?tid=31129 https://www.lexaloffle.com/bbs/?tid=31129 Sun, 15 Apr 2018 15:19:38 UTC Tweetjam 3D Donut <p> <table><tr><td> <a href="/bbs/?pid=50803#p"> <img src="/bbs/thumbs/pico50802.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=50803#p"> Tweetjam 3D Donut</a><br><br> by <a href="/bbs/?uid=16330"> 2darray</a> <br><br><br> <a href="/bbs/?pid=50803#p"> [Click to Play]</a> </td></tr></table> </p> <p>It's a frosted 3D donut, drawn in 265 chars of Lua!</p> <p>I'm including the code here, with spacing and indents for legibility (instead of minimizing chars like in the cart).</p> <p><strong>Variable meanings:</strong><br /> X/Y/Z: Current sample position (moves along a camera ray), +Y is up<br /> I/J: Screenspace position<br /> U/V/W: Ray direction (normalized)<br /> C: Output color of the current ray<br /> K: Raymarch iterator<br /> Q: Distance to the unextruded torus on XZ plane<br /> L: Shortest distance to the surface of the extruded 3D torus<br /> A: Angular position of sample pos around the torus (0-1, repeating)</p> <p>(Both distance values are signed: a negative distance means that a point is inside a shape)</p> <div> <div style="max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre> cls(2) ::_:: x=0 y=2 z=-3 i=rnd(112)+8 j=rnd(66)+40 u=i/128-.5 v=-(j/128) w=sqrt(1-u*u-v*v) c=2 for k=1,20 do q=sqrt(x*x+z*z)-1 l=sqrt(q*q+y*y)-.5 if (z&gt;4 or y&lt;-1) then break end if (l&lt;.08) then a=t()/64+atan2(z,x) c=(-y*5-.3+sin(a*6)/4) break end x+=u*l y+=v*l z+=w*l end pset(i,j,max(c%16,1)) goto _ </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> https://www.lexaloffle.com/bbs/?tid=31001 https://www.lexaloffle.com/bbs/?tid=31001 Sun, 25 Mar 2018 14:12:31 UTC 3D Material Capture <p> <table><tr><td> <a href="/bbs/?pid=50081#p"> <img src="/bbs/thumbs/pico50080.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=50081#p"> 3D Material Capture 1.0</a><br><br> by <a href="/bbs/?uid=16330"> 2darray</a> <br><br><br> <a href="/bbs/?pid=50081#p"> [Click to Play]</a> </td></tr></table> </p> <p>Material Capture, or &quot;matcap&quot; for short, is a really neat technique, and now that I've learned about it, I'm pretty surprised that it doesn't come up more often in gamedev conversations. It's great! Here's a pico8 implementation of the concept: it draws approximated realtime reflections on 3D meshes.</p> <p>There are three settings that you can change while it's running:</p> <p>Right/Left: Switch materials<br /> Up/Down: Fast-mode / Slow-mode<br /> O/X: Switch models</p> <p>Fast-mode is kind of like a vertex shader in modern 3D engines (the material texture is only sampled along the edges of triangles). Slow-mode is kind of like a pixel shader (except there's no GPU to give it a speed boost)</p> https://www.lexaloffle.com/bbs/?tid=30911 https://www.lexaloffle.com/bbs/?tid=30911 Wed, 07 Mar 2018 22:54:05 UTC Desert Road (generated animation) <p> <table><tr><td> <a href="/bbs/?pid=48976#p"> <img src="/bbs/thumbs/pico48972.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=48976#p"> Desert Road (generated animation)</a><br><br> by <a href="/bbs/?uid=16330"> 2darray</a> <br><br><br> <a href="/bbs/?pid=48976#p"> [Click to Play]</a> </td></tr></table> </p> <p>Hello again!</p> <p>Here's something I made this weekend - I recreated a pixel art image which was made by @Kldpxl:</p> <p><a href="https://twitter.com/Kldpxl/status/944196919643070464">https://twitter.com/Kldpxl/status/944196919643070464</a></p> <p>I love his pixel art because it often has a really striking photographic look about it, so I tried to carry that effect over as much as I could.</p> <p>Some features:</p> <ul> <li>It's 100% code: all sprites are generated at load time</li> <li>Textured ground plane with perspective distortion</li> <li>Value noise with multiple octaves (used for building all textures)</li> <li>Raymarcher for generating sprites with lighting: <ul> <li>Four types of plants</li> <li>Background mountains</li> <li>Horizontally-tiling clouds</li> </ul></li> <li>3D-positioned plant billboards</li> <li>3D extrusion for low grass and road lines</li> </ul> <p>I think it even runs at 60 fps!</p> https://www.lexaloffle.com/bbs/?tid=30727 https://www.lexaloffle.com/bbs/?tid=30727 Sun, 04 Feb 2018 16:53:07 UTC Tiny Platformer (Tutorial/Example Project) <p> <table><tr><td> <a href="/bbs/?pid=48607#p"> <img src="/bbs/thumbs/pico48605.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=48607#p"> Tiny Platformer (Tutorial/Example Project) 1.0</a><br><br> by <a href="/bbs/?uid=16330"> 2darray</a> <br><br><br> <a href="/bbs/?pid=48607#p"> [Click to Play]</a> </td></tr></table> </p> <p>Hello there! This is an example project which is intended to help people learn about making platformers in Pico-8.</p> <p>The game is free to play, but the source code for this version has been obfuscated, so it's not really practical to look through it. To read the normal-and-legible version of the source code (with or without comments), you can <a href="https://2darray.itch.io/tinyplatformer">buy it for at-least-$1 on itch.io</a>. As long as you make your own map, you can even sell games that use this code! If you didn't already know, itch.io has very nice support for Pico-8 games.</p> <p>Anyway, it's a cute little platformer with a grappling hook (you get the hook about halfway through) and a big finale! The main goal was to make a piece of illustrative/educational content which was centered around a real and complete game. See, &quot;Madness Interactive&quot; taught me that reading source code for a game that's fun to play can be much more exciting than reading a code snippet in the middle of some online tutorial. Not sure if I succeeded, but I tried real hard!</p> <p>Huge thanks to David Carney for helping me with the music, and also to everyone who volunteered to test the game! Y'all made the game better.</p> <p>A first run seems to take 20-45 minutes or so, but it depends on the player, and a fast runthrough is around three and a half minutes. If you record a video of a run that's faster than that, I'd love to see it!</p> https://www.lexaloffle.com/bbs/?tid=30669 https://www.lexaloffle.com/bbs/?tid=30669 Sat, 27 Jan 2018 18:52:39 UTC Music Fountain (plus example code) <p> <table><tr><td> <a href="/bbs/?pid=47257#p"> <img src="/bbs/thumbs/pico47254.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=47257#p"> Music Fountain</a><br><br> by <a href="/bbs/?uid=16330"> 2darray</a> <br><br><br> <a href="/bbs/?pid=47257#p"> [Click to Play]</a> </td></tr></table> </p> <p>A particle effect that spawns streams based on the music that's playing!</p> <p>The song is a chiptune cover of &quot;STONEFIST&quot; by HEALTH.</p> <p>It never stops repeating once it starts, but the music loop is maybe 45 seconds long.</p> <p>Here's an example of how to do some basic stuff that reacts to music:</p> <div> <div style="max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre> // pick a channel - a number from 0-3 // (0 is the far-left channel in the music editor) channel=0 // get the sfx index that's playing in this channel // (the number at the top of an enabled music channel's column) sound=stat(16+channel) // get the current timeline position of this channel (0-31) row=stat(20+channel) // get the two bytes representing the channel's current note byte1=peek(0x3200+68*sound+row*2) byte2=peek(0x3200+68*sound+row*2+1) // now we can extract the note values! // all three of these return 0-7 volume=band(byte2,0b1110)/2 effect=band(byte2,0b1110000)/16 instrument=band(byte1,0b11000000)/64 instrument+=band(byte2,1)*4 </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>More info about the audio memory layout is available <a href="https://gist.github.com/paniq/7814560e2b560b76911b"><strong>here</strong></a>.</p> https://www.lexaloffle.com/bbs/?tid=30420 https://www.lexaloffle.com/bbs/?tid=30420 Sun, 10 Dec 2017 16:15:15 UTC Self Portrait <p> <table><tr><td> <a href="/bbs/?pid=44286#p"> <img src="/bbs/thumbs/pico44285.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=44286#p"> Self Portrait</a><br><br> by <a href="/bbs/?uid=16330"> 2darray</a> <br><br><br> <a href="/bbs/?pid=44286#p"> [Click to Play]</a> </td></tr></table> </p> <p>I made an animated self-portrait!</p> <p>Some of it is rendered with drawing functions (the head shape, eyeballs, &quot;ear beams&quot; on the glasses, cheek-lines, etc), and other stuff done with sprites (frames of glasses, eyelids, most of the hair).</p> <p>Had a lot of fun making this - I recommend making one of yourself, or of someone else!</p> <p>I also added a fullscreen trail effect for some extra pizzazz, because it's an easy addition. Here's the code for that part, in case you want to use it in your own stuff - note that this will only allow you to &quot;fade to black&quot; over time, but you could modify it a bit to make it fade to a different color. It's...probably very difficult to control what colors it moves through as it approaches your target color, though, since it's abusing the two-pixels-per-byte format that pico8 uses for its screen buffer (which is also why it produces vertical stripes).</p> <div> <div style="max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre> for i=1,1100 do local x=flr(rnd(64)) local y=flr(rnd(128)) local m=8192*3 poke(m+y*64+x,peek(m+y*64+x)*.6) end </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> https://www.lexaloffle.com/bbs/?tid=29947 https://www.lexaloffle.com/bbs/?tid=29947 Sun, 17 Sep 2017 17:55:59 UTC FABRIK Pinwheel (Inverse Kinematics Demo) <p> <table><tr><td> <a href="/bbs/?pid=42901#p"> <img src="/bbs/thumbs/pico42900.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=42901#p"> FABRIK Pinwheel (Inverse Kinematics Demo)</a><br><br> by <a href="/bbs/?uid=16330"> 2darray</a> <br><br><br> <a href="/bbs/?pid=42901#p"> [Click to Play]</a> </td></tr></table> </p> <p>A barebones implementation of the FABRIK algorithm (&quot;Forward And Backward Reaching IK&quot;). Move the mouse around to control the IK target point.</p> <p>I think there's something kind of cute and coincidental about the way that it actually sorta looks like fabric.</p> <p>FABRIK is a clever trick that's surprisingly straightforward to implement, and it gives some really natural and performant results. The general principle is that instead of doing gradient descent or other fancy math for IK, you just imagine that your IK chain is a string (for 2D strings, imagine that they're resting on a table, and you're viewing from above).</p> <p>At each tick, you perform two loops through the chain: First, you &quot;pull the string&quot; by the end point to the target position (and some amount of the rest of the string will get pulled along with it). After you've done this, you do the same thing, but this time, you pull the root of the string to the anchor point. (If the IK chain is a person's arm, then the anchor point is the shoulder.)</p> <p>The source code also includes a 2D-distance check that tries to avoid number-overflow (by sacrificing some precision) when you give it a large enough vector. Might not be tuned perfectly (I really just guessed about the &quot;safe range&quot;), but maybe some motivated party can math out a more rigorous version of the function!</p> https://www.lexaloffle.com/bbs/?tid=29726 https://www.lexaloffle.com/bbs/?tid=29726 Sat, 29 Jul 2017 19:09:35 UTC Fractal Flames (Genetic Algorithm) <p> <table><tr><td> <a href="/bbs/?pid=42361#p"> <img src="/bbs/thumbs/pico42360.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=42361#p"> Fractal Flames (Genetic Algorithm) 1.0</a><br><br> by <a href="/bbs/?uid=16330"> 2darray</a> <br><br><br> <a href="/bbs/?pid=42361#p"> [Click to Play]</a> </td></tr></table> </p> <p>A weird animated image generator, based on the screensaver &quot;Electric Sheep&quot; (except way less powerful).</p> <p><strong>USAGE INSTRUCTIONS</strong></p> <p>Press Z to generate a new flame.</p> <p>Press S to save the current flame.</p> <p>Press X to view saved flames.</p> <p>When viewing saved flames, press Up/Down to move the cursor between saved flames.</p> <p>When viewing saved flames, press F to select/deselect a flame.</p> <p>When viewing saved flames, press Z to load the selected flame (instead of generating a new one).</p> <p>If you have flames selected and you close the saved-flame-view (by pressing X), then any new flames that are generated will be bred from the flames that you've selected (as parents).</p> <p>For example: If you select one flame, close the selector, and generate new ones, they will all at least vaguely resemble the one that you selected. If you select more than one parent and generate new ones, then the new ones will inherit traits from all selected parents (plus some randomized mutations).</p> <p>Post me your prettiest children in the comments!</p> https://www.lexaloffle.com/bbs/?tid=29629 https://www.lexaloffle.com/bbs/?tid=29629 Mon, 10 Jul 2017 21:42:06 UTC Forest Road Scene <p> <table><tr><td> <a href="/bbs/?pid=42208#p"> <img src="/bbs/thumbs/pico42207.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=42208#p"> Forest Road Scene</a><br><br> by <a href="/bbs/?uid=16330"> 2darray</a> <br><br><br> <a href="/bbs/?pid=42208#p"> [Click to Play]</a> </td></tr></table> <br /> A non-interactive view of a scene. It's roughly based on something I saw a few days ago, which reminded me of Virginia.</p> <p>Some features:</p> <ul> <li>Infinite random props</li> <li>&quot;Immediate mode&quot; rendering - no spawning/deleting/pooling props</li> <li>Smooth LOD on tree leaves (more leaves on nearby trees)</li> </ul> <p>Source code is commented, but the least-intuitive part of it (infinitely looping random objects) isn't really explained in there, because it would be a huge comment. Instead, here we go:</p> <p>First, think of the casino signs with a ring of lights around them. When they light up one at a time in sequence, it can appear like a &quot;single light&quot; is &quot;moving around&quot; the sign, even though it's really different lights which are blinking at choreographed times. Our trees in this demo work similarly, but we can also move the positions of the lights separately from changing their states. Also, instead of on-or-off, each tree is given a persistent random seed.</p> <p>Other than that, it's all pretty normal, I think?</p> https://www.lexaloffle.com/bbs/?tid=29594 https://www.lexaloffle.com/bbs/?tid=29594 Wed, 05 Jul 2017 15:09:45 UTC Nighttime Skyline Generator <p> <table><tr><td> <a href="/bbs/?pid=42147#p"> <img src="/bbs/thumbs/pico42148.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=42147#p"> Nighttime Skyline Generator</a><br><br> by <a href="/bbs/?uid=16330"> 2darray</a> <br><br><br> <a href="/bbs/?pid=42147#p"> [Click to Play]</a> </td></tr></table> </p> <p>Just a little image generator. Generates buildings, a moon, some stars, and a reflective body of water. Nothing particularly fancy going on here; the code is probably relatively self-explanatory</p> https://www.lexaloffle.com/bbs/?tid=29583 https://www.lexaloffle.com/bbs/?tid=29583 Sun, 02 Jul 2017 14:32:40 UTC L-System Generated Windy Plants <p> <table><tr><td> <a href="/bbs/?pid=42123#p"> <img src="/bbs/thumbs/pico42122.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=42123#p"> L-System Generated Windy Plants</a><br><br> by <a href="/bbs/?uid=16330"> 2darray</a> <br><br><br> <a href="/bbs/?pid=42123#p"> [Click to Play]</a> </td></tr></table> <br /> I learned about L-systems the other day, so here's my first shot at making one. It generates a plant whenever you hit the main action button.</p> <p><strong>L-System Parameters:</strong></p> <div> <div style="max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre> axiom=&quot;a&quot; rules={} rules[&quot;a&quot;]={&quot;b{c}b&quot;,&quot;c{b}c&quot;} rules[&quot;b&quot;]={&quot;a{a.}&quot;,&quot;a(bb.)&quot;} rules[&quot;c&quot;]={&quot;(ab.)&quot;,&quot;(b)&quot;} </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>Constants are any characters that don't appear as a rule index - all rules for a given variable have an equal chance of being chosen. The generator runs five iterations for each plant.</p> <p>A means &quot;go forward,&quot; B and C mean &quot;turn and go forward,&quot; {} and () mean &quot;start a new branch and turn afterward,&quot; and . means &quot;draw a circle.&quot;</p> <p>All animation comes from the rendering portion - the L-system only runs to initially create the plant.</p> https://www.lexaloffle.com/bbs/?tid=29578 https://www.lexaloffle.com/bbs/?tid=29578 Sat, 01 Jul 2017 13:41:50 UTC Simple Rotation Example <p> <table><tr><td> <a href="/bbs/?pid=40230#p"> <img src="/bbs/thumbs/pico40228.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=40230#p"> Simple Rotation Example</a><br><br> by <a href="/bbs/?uid=16330"> 2darray</a> <br><br><br> <a href="/bbs/?pid=40230#p"> [Click to Play]</a> </td></tr></table> </p> <p>Just a simple little 2D-rotation example.</p> <p>The function takes a 2D position (X,Y) and rotates it by ANGLE. CX,CY represents the center/pivot point.</p> <p>The lines of code in the middle are the rotation matrix:</p> <div> <div style="max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre> local rotx=cosa*x-sina*y local roty=sina*x+cosa*y </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>This rotates a point around the origin. Before and after doing so, we offset our position by our center coordinate - this lets us rotate around any arbitrary pivot point.</p> <p>For bonus points: When you're rotating lots of objects by the same angle (like a camera rotating, or a complex prop rotating), you can re-use your SINA and COSA values.</p> https://www.lexaloffle.com/bbs/?tid=29275 https://www.lexaloffle.com/bbs/?tid=29275 Fri, 05 May 2017 22:07:26 UTC 3D Car Rendering Demo <p> <table><tr><td> <a href="/bbs/?pid=39672#p"> <img src="/bbs/thumbs/pico39671.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=39672#p"> 3D Car Rendering Demo</a><br><br> by <a href="/bbs/?uid=16330"> 2darray</a> <br><br><br> <a href="/bbs/?pid=39672#p"> [Click to Play]</a> </td></tr></table> </p> <p>First real test-case for a <a href="https://twitter.com/2DArray/status/852276873199570944">3D prop editor I've been making for Pico8</a>.</p> <p>There's no interaction in this demo - it's just four cars that drive around the screen. They also don't do any collision detection or avoidance, so they just drive through each other sometimes.</p> <p>The point of the tool is that it lets you create and edit simple 3D props for use in Pico8 games. The editor is made in Pico8 so you can get a live preview with the same renderer that gets used in-game (crucial for lo-fi rendering!). The other reason that the editor is made in Pico8 was because it seemed like a funny thing to do.</p> <p>If you clicked the link to the gif above, you may have noticed a familiar face - the tool can import triangle meshes, so that clip is showing a render of Suzanne (the test-monkey from Blender).</p> <p>The workflow for making the cars goes like this:</p> <ol> <li> <p>Make a <a href="https://puu.sh/vkswB/4a57c83bed.png">car mesh in blender</a></p> </li> <li> <p>Run the mesh through a Unity utility I made that converts the model into a different coordinate space and <a href="https://puu.sh/vksC3/c4ccd19202.png">exports a serialized mesh</a></p> </li> <li> <p><a href="http://i.imgur.com/TlI5uFl.gif">Add tires in the Prop Editor</a> and tune up colors+triangles</p> </li> <li>Export to console, paste the model into another cartridge (which contains the renderer) as a giant string</li> </ol> <p>There's still room for improvement, but I'm at the point where I'd need to start optimizing out a bunch of tokens to add any more stuff to the editor. The renderer on its own is about 1700 tokens, so I think there's a reasonable amount of space left (&gt;6000 tokens) for it to be used in a releasable game. Also, while each model is only one token, a really complex model (by lo-fi standards) can end up being a few thousand characters...</p> <p>...but the serialization format is completely uncompressed right now - particularly, it includes every serialized variable name as plaintext (instead of just using a fixed order to infer the meanings of different numbers). This would cut the character-count down by a whole lot - like 50% smaller, or something.</p> <p>Will likely release the editor on the BBS, though it's worth noting that for it to really be useful, you need to run it in the standalone Pico8, because you have to start it from the command line in order to export your models.</p> <p>And for it to be fully-activated, you'd also want to be able to convert other meshes into the special serialization format. It's fun to make 3D stuff in this pico8 tool, but it's really not appropriate for making triangle meshes from scratch (no extrusion, edge loops, etc), so it's best to just do that elsewhere and import it into the tool for extra additions and final tuning. If you're a Unity user, I'd be happy to share my converter project with you. If you're not a Unity user but you do have some other 3D-model-scripting capability, I can explain how the middle-man works (that part is pretty simple)</p> <p>Not exactly sure what it'll be, but I'm gonna make some type of cool shit with this thing!</p> https://www.lexaloffle.com/bbs/?tid=29174 https://www.lexaloffle.com/bbs/?tid=29174 Fri, 14 Apr 2017 19:35:46 UTC Rebbitt Rancher (GGJ '17) <p> <table><tr><td> <a href="/bbs/?pid=36365#p"> <img src="/bbs/thumbs/pico36390.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=36365#p"> Rebbitt Rancher (GGJ '17)</a><br><br> by <a href="/bbs/?uid=16330"> 2darray</a> <br><br><br> <a href="/bbs/?pid=36365#p"> [Click to Play]</a> </td></tr></table> </p> <p>Protect your rebbitts from the angry magician!</p> <p>We made this for Global Game Jam 2017, at the Omaha, Nebraska site.</p> <p>Eli Piilonen (Code/Design)<br /> David Carney (Art/Audio)</p> <p>(Instructions are in-game)</p> https://www.lexaloffle.com/bbs/?tid=28693 https://www.lexaloffle.com/bbs/?tid=28693 Sun, 22 Jan 2017 16:05:42 UTC Drop-7 Professional <p> <table><tr><td> <a href="/bbs/?pid=35706#p"> <img src="/bbs/thumbs/pico35829.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=35706#p"> Drop-7 Professional (1.1.1)</a><br><br> by <a href="/bbs/?uid=16330"> 2darray</a> <br><br><br> <a href="/bbs/?pid=35706#p"> [Click to Play]</a> </td></tr></table> </p> <p> <table><tr><td> <a href="/bbs/?pid=35706#p"> <img src="/bbs/thumbs/pico35825.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=35706#p"> Drop-7 Professional (1.1)</a><br><br> by <a href="/bbs/?uid=16330"> 2darray</a> <br><br><br> <a href="/bbs/?pid=35706#p"> [Click to Play]</a> </td></tr></table> </p> <p> <table><tr><td> <a href="/bbs/?pid=35706#p"> <img src="/bbs/thumbs/pico35818.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=35706#p"> Drop-7 Professional (1.0)</a><br><br> by <a href="/bbs/?uid=16330"> 2darray</a> <br><br><br> <a href="/bbs/?pid=35706#p"> [Click to Play]</a> </td></tr></table> </p> <p> <table><tr><td> <a href="/bbs/?pid=35706#p"> <img src="/bbs/thumbs/pico35705.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=35706#p"> Drop7 (alpha)</a><br><br> by <a href="/bbs/?uid=16330"> 2darray</a> <br><br><br> <a href="/bbs/?pid=35706#p"> [Click to Play]</a> </td></tr></table> </p> <p>This is a port of my favorite mobile game, which was originally designed by Area/Code Entertainment. Zynga acquired the original version, and they promptly ruined the minimalist experience with a bunch of abrasive and irritating hooks. On top of that, all of the clones I've found have been kind of janky.</p> <p>Pico8 to the rescue! I'm trying to make the very best totally-free version of Drop7. Your feedback would be greatly appreciated!</p> <p>INSTRUCTIONS:</p> <p>Click to drop disks.</p> <p>A disk is destroyed if its number is equal to the size of the group that contains it. A &quot;group&quot; is a horizontal row or vertical column of adjacent disks (like Connect-4, except with no diagonals).</p> <p>For example: If you have five disks in a row along the bottom of the screen, any of those disks with a &quot;5&quot; label will be destroyed. Vertical columns of disks work, too.</p> <p>If you destroy a numbered disk while it's touching an unlabeled disk, then the unlabeled disk will take damage. If you damage an unlabeled disk twice, it will change into a random numbered disk.</p> <p>After every tenth disk you drop, a row of unlabled disks will rise from the bottom of the screen.</p> <p>If any disk ends up above the top of the gameplay grid, then you lose. Click anywhere to return to the main menu.</p> <hr /> <p>Version 1.1.1:</p> <p>(Hopefully) fixed a bug causing an error when you run the game for the first time. If you get an error on first launch, try refreshing the page...and then please leave a comment saying that the bug isn't fixed yet.</p> <hr /> <p>Version 1.1:</p> <p>Added three difficulty modes.</p> <hr /> <p>Version 1.0:</p> <p>Lots more polish compared to the alpha version - Drop-5 and Drop-10 modes, a main menu, scene transitions, a palette selection screen, and more!</p> <p>Experimenting with a feature that restricts certain unfair number spawns when an unlabeled disk pops inside a large cluster. Might make the game too easy, but then it seems like a feature that could be used for easy/training modes.</p> <hr /> <p>Alpha version:</p> <p>A basic Drop7 clone. Will be adding extra features and such over time.</p> https://www.lexaloffle.com/bbs/?tid=28571 https://www.lexaloffle.com/bbs/?tid=28571 Sat, 14 Jan 2017 20:01:03 UTC