2darray [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=16330 Happy Little Forest (pico1k 2022) <p> <table><tr><td> <a href="/bbs/?pid=116969#p"> <img src="/bbs/thumbs/pico8_happy_little_forest-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=116969#p"> happy_little_forest</a><br><br> by <a href="/bbs/?uid=16330"> 2darray</a> <br><br><br> <a href="/bbs/?pid=116969#p"> [Click to Play]</a> </td></tr></table> </p> <p>here's my entry for pico1k 2022!</p> <p>it's a 3D point-cloud renderer with SSAO - takes a minute or two to prepare the scene (may help to imagine a soothing voice saying stuff like &quot;now we're going to add some happy-little-clouds&quot;), then once it's done generating, it draws one &quot;shimmery&quot; image forever.</p> <hr /> <p>if you'd like to use this renderer to draw your own 3D scene (maybe for pico1k, maybe just for fun!), this thread has some info about how to use it:<br /> <blockquote class="twitter-tweet" data-lang="en"><a href="https://twitter.com/lexaloffle/status/1567122751252480000">[tweet <img src="/gfx/load16.gif">]</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script></p> <p>in short, you tell it to draw a ton of 3D points (no triangles!), it uses a z-buffer (no sorting!), and allows four independent color-ramps (SSAO can darken a color, but never moves it into a different four-color group)</p> https://www.lexaloffle.com/bbs/?tid=49214 https://www.lexaloffle.com/bbs/?tid=49214 Tue, 06 Sep 2022 14:21:34 UTC &quot;unblock&quot; UI-helper test <p> <table><tr><td> <a href="/bbs/?pid=102285#p"> <img src="/bbs/thumbs/pico8_unblock-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=102285#p"> unblock</a><br><br> by <a href="/bbs/?uid=16330"> 2darray</a> <br><br><br> <a href="/bbs/?pid=102285#p"> [Click to Play]</a> </td></tr></table> </p> <p>a not-quite-finished UI-layout helper based on the idea of working inside &quot;blocks&quot; which can contain smaller blocks - by default the full screen is a block, and then you can spawn smaller blocks inside of that, and inside of those, etc. you can print word-wrapped text into the current block, or if you do any custom drawing of your own, it'll occur in the current block's local space.</p> <p>i abandoned this pico8 version, because even though i like how the layout API feels to use, when i tried to use it for a &quot;real thing&quot; it was feeling too heavy (token-count and performance-cost) to be practical - but outside of pico8, these penalties wouldn't be relevant, so i may take another stab at it (probably in a different context) eventually.</p> <p>(posting because <a href="https://www.lexaloffle.com/bbs/?uid=27691"> @pancelor</a> asked to see the code while working on their own UI helper!)</p> https://www.lexaloffle.com/bbs/?tid=45640 https://www.lexaloffle.com/bbs/?tid=45640 Fri, 10 Dec 2021 07:52:12 UTC Another 3D Snake (for TweetTweetJam 7) <p> <table><tr><td> <a href="/bbs/?pid=100576#p"> <img src="/bbs/thumbs/pico8_another_3d_snake-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=100576#p"> another_3d_snake</a><br><br> by <a href="/bbs/?uid=16330"> 2darray</a> <br><br><br> <a href="/bbs/?pid=100576#p"> [Click to Play]</a> </td></tr></table> </p> <p><strong>it's the game snake, but 3D, in 552 bytes!</strong> this lil thing was made for TweetTweetJam 7.</p> <p><strong>moving:</strong> steer with left/right - steering is also how you move forward, because you are a snake</p> <p><strong>growing:</strong> eating olives is how you grow longer, because you are a snake</p> <p><strong>losing:</strong> touching your tail with your face is how you start over, because you are a snake in a video game</p> <p>if you grow your tail so long that your framerate suddenly reduces to garbage: <strong>you win!</strong></p> <hr /> <p>the code is nonsense, since it's a tweetjam, but here it is!</p> <div> <div class=scrollable_with_touch style="width:100%; 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>p={0,0,0,0}b=0a=0g=0h=0::_::cls(15)w=btn()w=w%2-w\2%2m=w*w*2a+=w*.015p[3]+=m*cos(a)p[4]+=m*sin(a)q=p[3]r=p[4]g+=(q-g)/9h+=(r-h)/9b+=(a-b)/40s=sin(-b)c=cos(-b)for j=0,1do for i=1,#p,2do _=min(i,2)u=p[i]v=p[i+1]f=_+2if(1-j)*i&gt;=5then x=p[i-2]y=p[i-1]u-=x v-=y l=2/(u*u+v*v)^.5u=x+u*l v=y+v*l p[i]=u p[i+1]=v end if abs(q-u)+abs(r-v)&lt;30-_*10then if i&lt;2then for j=1,36do add(p,p[#p-1])end p[1]=rnd(198)-99p[2]=rnd(198)-99 elseif i&gt;40then run() end end u-=g v-=h u,v=s*u+c*v,c*u-s*v k=99/max(150+v,1)circfill(64+u*k,34+60*k-j,5*k-j,f+j*5)end end flip()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=45438 https://www.lexaloffle.com/bbs/?tid=45438 Sun, 21 Nov 2021 21:03:34 UTC Deal Or No Deal <p> <table><tr><td> <a href="/bbs/?pid=85103#p"> <img src="/bbs/thumbs/pico8_deal_or_no_deal-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=85103#p"> deal_or_no_deal</a><br><br> by <a href="/bbs/?uid=16330"> 2darray</a> <br><br><br> <a href="/bbs/?pid=85103#p"> [Click to Play]</a> </td></tr></table> </p> <p>It's the game &quot;Deal Or No Deal,&quot; except with fewer commercial breaks.</p> <p>The whole game is clicking buttons, so a mouse is required! You probably don't need to be familiar with the show to play, but let me know if it's confusing, and I can try to figure out how to communicate the rules better.</p> <p>Currently missing some stuff like music/sound and a title screen, but you can go through a full round and it works &quot;pretty much like the show.&quot;</p> https://www.lexaloffle.com/bbs/?tid=40682 https://www.lexaloffle.com/bbs/?tid=40682 Mon, 07 Dec 2020 00:00:23 UTC Jump-Flood Algorithm Example <p> <table><tr><td> <a href="/bbs/?pid=82362#p"> <img src="/bbs/thumbs/pico8_jump_flood-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=82362#p"> jump_flood</a><br><br> by <a href="/bbs/?uid=16330"> 2darray</a> <br><br><br> <a href="/bbs/?pid=82362#p"> [Click to Play]</a> </td></tr></table> </p> <p>I made this for practice, to try out the Jump-Flood Algorithm, but it turned into a little interactive click-through thing, so here it is. It might be a little hard to understand at first, but if you're interested in parallel processing, it's an extremely powerful tool.</p> <p>Jump-Flood is useful for &quot;parallel-fill&quot; operations. For detailed information, <a href="https://medium.com/@bgolus/the-quest-for-very-wide-outlines-ba82ed442cd9">this wonderful article</a> by Ben Golus explains why and how you might want to use the Jump-Flood Algorithm for a realtime &quot;perfect thick outline&quot; post-processing shader, by live-generating a 2D distance field from a rasterized silhouette.</p> <p>In this simpler example, the input is a 1-dimensional sequence of increasing numbers, with an unpredictable number of trailing zeroes after each unique value. The goal is to &quot;fill-forward&quot; each unique value, so it gets copied over all of its immediately-trailing zeroes. This is easy to do in a serial process, &quot;CPU-style&quot; (just one big for-loop through the whole list, remembering the most recent nonzero value and overwriting any zeroes with it) - but it's much more complicated if you want to solve this same problem with a parallel routine - for example, in a GPU program, for a big list! The naive parallel approaches are very wasteful, and they scale very poorly by comparison.</p> <p>Note that this demo shows the process running one &quot;slot&quot; at a time in each row (for clarity), but each pass of this algorithm (one row of digits) can be performed fully parallel.</p> <p>The really compelling thing about this method is that when run in a parallel way, it deals with large amounts of data incredibly well: the cost scales as O(log2(N)), where N is the size of the largest continuous sequence of zeroes in the input list (the maximum &quot;fill distance&quot;). A beautiful algorithm!</p> https://www.lexaloffle.com/bbs/?tid=39755 https://www.lexaloffle.com/bbs/?tid=39755 Sun, 27 Sep 2020 05:05:22 UTC Toboggoban <p> <table><tr><td> <a href="/bbs/?pid=71027#p"> <img src="/bbs/thumbs/pico8_toboggoban-12.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=71027#p"> toboggoban</a><br><br> by <a href="/bbs/?uid=16330"> 2darray</a> <br><br><br> <a href="/bbs/?pid=71027#p"> [Click to Play]</a> </td></tr></table> </p> <p>It's time for Toboggoban! A Sokoban-variant featuring wintery vibes and sliding toboggans.</p> <p>This game was made for the <a href="https://www.lexaloffle.com/bbs/?tid=36076">2019 Advent Calendar</a> - check it out for a bunch of other wintery content from other developers, gradually unlocking throughout December 2019!</p> <p>Arrows: Move<br /> Z: Undo<br /> X: Reset level</p> <hr /> <p><em>Awkward special note: This game uses a music track supplied by <a href="https://www.lexaloffle.com/bbs/?uid=11292">Gruber</a>, but it plays a version of his song which I modified to be less melodic (for a less-distracting puzzle-solving backdrop). My edited version isn't as good as the original song, so if you don't like the gameplay music, don't go blaming it on Gruber (check his profile - his work is A++). His original track plays during the final cutscene, so if you beat the game, you get to hear it properly!</em></p> https://www.lexaloffle.com/bbs/?tid=36255 https://www.lexaloffle.com/bbs/?tid=36255 Sun, 15 Dec 2019 02:47:03 UTC Palette-Maker <p> <table><tr><td> <a href="/bbs/?pid=68190#p"> <img src="/bbs/thumbs/pico8_palette_maker-8.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=68190#p"> palette_maker</a><br><br> by <a href="/bbs/?uid=16330"> 2darray</a> <br><br><br> <a href="/bbs/?pid=68190#p"> [Click to Play]</a> </td></tr></table> </p> <p>A tool for creating palettes! Supports the default 16 colors and the secret extra-set of 16 bonus colors (you can use items from both in your palette, but you can only select 16 colors in total).</p> <p><strong>BUILDING A PALETTE</strong></p> <p>Click a color in the 4x4 grid to select/deselect it. Click the Default/Alternate buttons on the left (or press Z) to switch the picker-grid between default colors and &quot;special dark&quot; colors.</p> <p>Click and drag colors you've already chosen (at the top) to reorder them.</p> <p><strong>EXPORTING YOUR PALETTE TO THE CLIPBOARD</strong></p> <p>To export your palette, click the Copy button (see note below). This exports your palette as a single line of Lua, which you can paste into another pico8 editor (or a text file). You can put this line of Lua into your <strong>_INIT()</strong> function, or at the very top of your script, or at whatever point where you want the palette to change.</p> <p>Example output:</p> <div> <div class=scrollable_with_touch style="width:100%; 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>pal({[0]=132,4,143,15},1)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>&gt; (NOTE!) If you're running the palette maker on the BBS, when you click the Copy button, you'll get a popup telling you how to complete the operation - at the time of writing, pico8 pops up a red message telling you to press ctrl-C or cmd-C to complete the copy-operation - so for windows-web, the export process is to click Copy and then hit Ctrl+C, then go to your other app/window and hit Ctrl+V. If you want to skip that extra step, run the palette maker locally (you can use the command <strong>LOAD #PALETTE_MAKER</strong> from the pico8 entry screen to download it) - in the local editor, the Copy button alters your clipboard contents immediately.</p> <p><strong>AUTO-SORTING YOUR PALETTE</strong></p> <p>Click the <strong>SORT</strong> button to attempt to auto-sort your palette - for simple palettes, like monochrome stuff, this should work &quot;as expected,&quot; producing a ramp from dark to bright. For stranger palettes, it'll do its best to minimize the HSV difference and acceleration between neighbors in HSV space (the cart's thumbnail is the full 16-color default palette, after sorting with this method).</p> <p><strong>TWEETJAM-EXPORT MODE</strong></p> <p>Click the blue twitter-bird button to toggle tweetjam-export mode, which always produces a shorter output for the same palette, compared to the default (more-legible) output mode. Tweetjam-export is also relevant if you're optimizing tokens: no matter how many colors your palette includes, the output in tweetjam mode will be 2 tokens. If you're going for lowest-possible char-count: adding 1 extra default-palette color costs 1 extra byte, but adding 1 extra alt-palette color costs 2 extra bytes, because it gets encoded as an emoji.</p> <p>Example output in tweetjam-mode:</p> <div> <div class=scrollable_with_touch style="width:100%; 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>?&quot;\^!5f102β–‘4&hearts;7?β—†πŸ…ΎοΈμ›ƒ9&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><strong>SHOUTOUTS</strong></p> <p>If you'd like to edit your palette inside the context of your actual game, you may be interested in <a href="https://www.lexaloffle.com/bbs/?uid=38130"> @BoneVolt</a>'s utility, <a href="https://www.lexaloffle.com/bbs/?tid=39910">Painto-8 Lite</a>!</p> <p>Special thanks to <a href="https://www.lexaloffle.com/bbs/?uid=27691"> @pancelor</a> for showing how palettes (which use color 133) can shave a byte in tweetjam-mode by replacing <code>✽</code> with <code>Λ‡</code> - both of these glyphs mean &quot;color 133&quot; when used in a palette-string, but unlike other p8-emoji-glyphs, twitter only counts <code>Λ‡</code> as a single byte, instead of two!</p> https://www.lexaloffle.com/bbs/?tid=35462 https://www.lexaloffle.com/bbs/?tid=35462 Fri, 27 Sep 2019 17:21:09 UTC Cached Rotation Matrix Drawing <p> <table><tr><td> <a href="/bbs/?pid=67097#p"> <img src="/bbs/thumbs/pico8_store_rotation_matrix-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=67097#p"> store_rotation_matrix</a><br><br> by <a href="/bbs/?uid=16330"> 2darray</a> <br><br><br> <a href="/bbs/?pid=67097#p"> [Click to Play]</a> </td></tr></table> </p> <p>Quick example of how you can save a sin/cos result for an angle, and then draw a whole rotated object with a bunch of drawing-API calls which all re-use the trig results.</p> https://www.lexaloffle.com/bbs/?tid=35225 https://www.lexaloffle.com/bbs/?tid=35225 Sun, 01 Sep 2019 13:43:20 UTC Water Balloon Physics <p> <table><tr><td> <a href="/bbs/?pid=66345#p"> <img src="/bbs/thumbs/pico8_waterballoon_physics-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=66345#p"> waterballoon_physics</a><br><br> by <a href="/bbs/?uid=16330"> 2darray</a> <br><br><br> <a href="/bbs/?pid=66345#p"> [Click to Play]</a> </td></tr></table> </p> <p>Sketched out some water balloon physics - press any P8 button to restart with a randomized balloon size.</p> https://www.lexaloffle.com/bbs/?tid=34943 https://www.lexaloffle.com/bbs/?tid=34943 Sun, 04 Aug 2019 00:37:42 UTC &quot;Ladybug&quot; Scene/Renderer <p> <table><tr><td> <a href="/bbs/?pid=64769#p"> <img src="/bbs/thumbs/pico8_point_cloud_ladybug-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=64769#p"> point_cloud_ladybug</a><br><br> by <a href="/bbs/?uid=16330"> 2darray</a> <br><br><br> <a href="/bbs/?pid=64769#p"> [Click to Play]</a> </td></tr></table> </p> <p>I took a shot at &quot;demaking&quot; an image made by Inigo Quilez. His original piece draws an animated scene which is modeled and rendered entirely by code which runs on the GPU (<strong>note:</strong> this link takes you to a webpage which runs heavy GPU code, and it will likely slow down your browser while it's running): <a href="https://www.shadertoy.com/view/4tByz3">https://www.shadertoy.com/view/4tByz3</a></p> <p>My version is a lot simpler. It draws a single still image in two passes (first a depth/material-ID pass, then a lighting pass to get the final result), so be patient! Nothing else happens after it finishes drawing the image.</p> <p>Unlike the original version, which uses Signed Distance Field modeling to describe its shapes, I used a point-cloud generator/rasterizer which uses a z-buffer for sorting (very similar to the triangle-renderers used in almost all current 3D game engines, but it only draws points instead of triangles). Each object on the screen is created by some function which submits a sequence of 3D positions with material values to to the rasterizer.</p> <p>All lighting operations (diffuse + specular + approximated directional shadows + SSAO) are performed as a post-process, like deferred rendering in modern environments. Since the shapes in the scene are just arbitrary collections of points, they don't have &quot;real&quot; normals - instead, all normals are approximated based on the depth buffer, after all the points have been rasterized.</p> https://www.lexaloffle.com/bbs/?tid=34339 https://www.lexaloffle.com/bbs/?tid=34339 Sun, 26 May 2019 21:17:33 UTC 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 class=scrollable_with_touch style="width:100%; 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 class=scrollable_with_touch style="width:100%; 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