thykka [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=48049 Planetary physics <p>Newtonian gravity simulation</p> <p>It's a bit unstable. Vector math and fixed point numbers don't mix too well, although I'm sure this could be modified to better utilize the available digit range..</p> <p>Press Z to pause and adjust the velocities.<br /> Press Ctrl+R to reset the simulation.</p> <p> <table><tr><td> <a href="/bbs/?pid=93346#p"> <img src="/bbs/thumbs/pico8_newtgrav-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=93346#p"> newtgrav</a><br><br> by <a href="/bbs/?uid=48049"> thykka</a> <br><br><br> <a href="/bbs/?pid=93346#p"> [Click to Play]</a> </td></tr></table> </p> https://www.lexaloffle.com/bbs/?tid=43296 https://www.lexaloffle.com/bbs/?tid=43296 Fri, 11 Jun 2021 09:12:15 UTC Sierpinski Attractor <p>It does <a href="https://www.youtube.com/watch?v=kbKtFN71Lfs&amp;amp;t=5s">this</a>.</p> <p> <table><tr><td> <a href="/bbs/?pid=93317#p"> <img src="/bbs/thumbs/pico8_sirpinski2-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=93317#p"> sirpinski2</a><br><br> by <a href="/bbs/?uid=48049"> thykka</a> <br><br><br> <a href="/bbs/?pid=93317#p"> [Click to Play]</a> </td></tr></table> </p> <p>Move the mouse to restart</p> <p>Old version: <div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;"> <table><tr><td> <a href="/bbs/?pid=93317#p"> <img src="/bbs/thumbs/pico8_sirpinski-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=93317#p"> sirpinski</a><br><br> by <a href="/bbs/?uid=48049"> thykka</a> <br><br><br> <a href="/bbs/?pid=93317#p"> [Click to Play]</a> </td></tr></table> </div></div></div></p> https://www.lexaloffle.com/bbs/?tid=43293 https://www.lexaloffle.com/bbs/?tid=43293 Thu, 10 Jun 2021 19:57:52 UTC Barnsley fern explorer <p> <table><tr><td> <a href="/bbs/?pid=92823#p"> <img src="/bbs/thumbs/pico8_bons8-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=92823#p"> bons8</a><br><br> by <a href="/bbs/?uid=48049"> thykka</a> <br><br><br> <a href="/bbs/?pid=92823#p"> [Click to Play]</a> </td></tr></table> </p> https://www.lexaloffle.com/bbs/?tid=43127 https://www.lexaloffle.com/bbs/?tid=43127 Sun, 30 May 2021 22:53:45 UTC PePu invite 19/2021 <p> <table><tr><td> <a href="/bbs/?pid=92129#p"> <img src="/bbs/thumbs/pico8_pepu_invite_19_2021-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=92129#p"> pepu_invite_19_2021</a><br><br> by <a href="/bbs/?uid=48049"> thykka</a> <br><br><br> <a href="/bbs/?pid=92129#p"> [Click to Play]</a> </td></tr></table> </p> https://www.lexaloffle.com/bbs/?tid=42933 https://www.lexaloffle.com/bbs/?tid=42933 Tue, 18 May 2021 13:26:13 UTC Animation/tweening library [WIP] <p>I'm working on this small animation library. It adds a straightforward way to animate an object's state. </p> <h3>Usage example:</h3> <p>Let's say there's a game object called &quot;progress&quot;, representing a progress bar we want to animate:</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>progress={value=0}</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>we could animate the value rising from 0 to 100 by adding this to something that triggers the progress to start:</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>tween(progress,{value=100})</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>and in _update() we want to call the animate() function to keep updating the value, until it's duration has elapsed:</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>if has_animations(progress) then animate(progress) end</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <h3>Demo</h3> <p> <table><tr><td> <a href="/bbs/?pid=87978#p"> <img src="/bbs/thumbs/pico8_tweendemo-2.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=87978#p"> tweendemo</a><br><br> by <a href="/bbs/?uid=48049"> thykka</a> <br><br><br> <a href="/bbs/?pid=87978#p"> [Click to Play]</a> </td></tr></table> </p> <h3>Configuration</h3> <p>There are some global variables you can override:</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>animate_default_duration=0.4 animate_default_easing=ease_quad_out animate_key=&quot;__a&quot; --which key should contain the tweening animation state</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>You can also add your own easing functions:</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>function my_easing(t) return t*t*t end add(animate_easings,my_easing) ease_my_easing=#animate_easings</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <h3>Arguments</h3> <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>tween(node,target,options)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <ul> <li><em>node</em> - table that contains the value that should be animated</li> <li><em>target</em> - table of the values that should be tweened</li> <li>[<em>options.duration</em>] - how long the tween should play</li> <li>[<em>options.easing</em>] - easing function (included easings: linear, quad_in, quad_out and quad_in_out)</li> <li>[<em>options.custom_time</em>] - custom starting time</li> </ul> <p>Tweens are removed automatically once the animation completes. Starting a new animation for a key with an active animation will overwrite the previous one, continuing animating from it's current value.</p> <h3>Download</h3> <p>The most recent version is available at <a href="https://github.com/thykka/pico-8-libs/blob/main/animate.lua">https://github.com/thykka/pico-8-libs/blob/main/animate.lua</a></p> <h3>Changelog</h3> <ul> <li>v3 <ul> <li>refactored &amp; parametrized almost everything</li> <li>animate_key() replaced by tween()</li> <li>can now tween multiple values with one tween() call</li> </ul></li> </ul> https://www.lexaloffle.com/bbs/?tid=41697 https://www.lexaloffle.com/bbs/?tid=41697 Sun, 21 Feb 2021 18:35:05 UTC BoozeSnek <h1>BoozeSnek</h1> <p>Official port of <a href="https://script-8.github.io/?id=d6813988ba7a22c2d9cfc6fdef4a5dad">PePuSnek for SCRIPT-8</a>, improved.</p> <h2>WARNING: Contains flashing lights!</h2> <p> <table><tr><td> <a href="/bbs/?pid=84020#p"> <img src="/bbs/thumbs/pico8_snek8-5.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=84020#p"> BoozeSnek</a><br><br> by <a href="/bbs/?uid=48049"> thykka</a> <br><br><br> <a href="/bbs/?pid=84020#p"> [Click to Play]</a> </td></tr></table> </p> <h3>Changelog</h3> <ul> <li>14-11-2020 <ul> <li>Changed scoring rules; points are now accumulated, instead of calculated when the game ends</li> <li>Added persistent HiScores</li> <li>Music on/off setting is now persistent</li> </ul></li> </ul> https://www.lexaloffle.com/bbs/?tid=40306 https://www.lexaloffle.com/bbs/?tid=40306 Sat, 14 Nov 2020 19:05:34 UTC Screen fill benchmark <p>Checking out a couple of different methods to fill the screen.</p> <p>cls seem slightly faster than memset. I wonder if the difference is due to the multiplication op, or if there's something else going on...</p> <p> <table><tr><td> <a href="/bbs/?pid=83719#p"> <img src="/bbs/thumbs/pico8_scrnfllbnchmrk-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=83719#p"> Screen fill benchmark 0.1</a><br><br> by <a href="/bbs/?uid=48049"> thykka</a> <br><br><br> <a href="/bbs/?pid=83719#p"> [Click to Play]</a> </td></tr></table> </p> <p>Left/Right switches modes</p> https://www.lexaloffle.com/bbs/?tid=40141 https://www.lexaloffle.com/bbs/?tid=40141 Wed, 04 Nov 2020 23:12:34 UTC cfds_intro_1 <h2>Hello, World!</h2> <p> <table><tr><td> <a href="/bbs/?pid=83631#p"> <img src="/bbs/thumbs/pico8_cfds_intro_1-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=83631#p"> cfds_intro_1</a><br><br> by <a href="/bbs/?uid=48049"> thykka</a> <br><br><br> <a href="/bbs/?pid=83631#p"> [Click to Play]</a> </td></tr></table> </p> <p>It's not a lot,<br /> but it's honest glitch.</p> https://www.lexaloffle.com/bbs/?tid=40121 https://www.lexaloffle.com/bbs/?tid=40121 Mon, 02 Nov 2020 22:05:14 UTC