kozm0naut [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=85395 Simple Animation System <p>Hi there!</p> <p>I've been using a relatively simple system for sprite animations that I find works pretty well without much overhead. It relies on a simple function to retrieve the current frame of an animation frame list (<code>ani</code>) based on <code>time</code> (<code>t()</code>) and a given speed (<code>spd</code>) in frames per second:</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>--get animation frame function anifrm(ani,spd) return ani[1+flr(spd*t()%#ani)] 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><strong><em>That's it!</em></strong></h3> <p>Now all we need is to define an animation as a list of sprite IDs:</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>--define player walk animation pwalkani={2,3,4,5}</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 we can assign this animation to our player just like assigning a single sprite:</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>--in _update(), during walk logic (e.g. btn left or right) player.sprite=anifrm(pwalkani,10) --in _draw(), using the normal spr() call spr(player.sprite,player.x,player.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>Here's an example cart to demonstrate fully, also taking sprite flipping into account:<br /> <table><tr><td> <a href="/bbs/?pid=151210#p"> <img src="/bbs/thumbs/pico8_koz_anidemo-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=151210#p"> koz_anidemo</a><br><br> by <a href="/bbs/?uid=85395"> kozm0naut</a> <br><br><br> <a href="/bbs/?pid=151210#p"> [Click to Play]</a> </td></tr></table> <br /> Full code:<br /> <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;"></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>player={ x=60, y=60, sprite=1, sprflip=false } --define player walk animation pwalkani={2,3,4,5} --get animation frame function anifrm(ani,spd) return ani[1+flr(spd*t()%#ani)] end function _update() if btn(⬅️) then player.x-=1 player.sprite=anifrm(pwalkani,10) player.sprflip=true elseif btn(➡️) then player.x+=1 player.sprite=anifrm(pwalkani,10) player.sprflip=false else player.sprite=1 player.sprflip=false end end function _draw() cls() spr(player.sprite,player.x,player.y,1,1,player.sprflip) end</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p></div></div></div></p> <p><em>Be aware that because this function is tied to global time (<code>t()</code>) the current frame shown isn't dependent on when the action began/the animation was set.</em></p> <p>Good luck and feel free to let me know if there are any questions or comments about this function or its usage!</p> https://www.lexaloffle.com/bbs/?tid=143102 https://www.lexaloffle.com/bbs/?tid=143102 Fri, 12 Jul 2024 04:54:13 UTC srviv <h1>srviv</h1> <p>Wield your blessed golden chakram against the oncoming vampire bat horde! Survive and take out as many as you can!</p> <img style="margin-bottom:16px" border=0 src="/media/85395/ttj p8_1.gif" alt="" /> <p>Survivors-type made in under 500 chars for tweettweetjam9. <a href="https://itch.io/jam/tweettweetjam-9/rate/2705168">Check it out on itch.io</a></p> <p> <table><tr><td> <a href="/bbs/?pid=148341#p"> <img src="/bbs/thumbs/pico8_srviv-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=148341#p"> srviv</a><br><br> by <a href="/bbs/?uid=85395"> kozm0naut</a> <br><br><br> <a href="/bbs/?pid=148341#p"> [Click to Play]</a> </td></tr></table> </p> <p>Reload the page to try again. I ran out of characters for a more elegant ending.</p> <p>Code below...<br /> <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;"></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>l=128x=64y=64c=0v=0p=0m=64n=64z={}r=rnd ★=sin 🐱=cos &hellip;=atan2 🅾️=circ ::☉::c=x-64v=y-64camera(c,v) for i=0,l do 🅾️(c+(i*i-c)%l,v+(i-v)%l,0,i%6)end?&quot;웃&quot;,x-3,y-2,6 u=r()if(u&lt;.1)add(z,{x=x+l*🐱(l*u),y=y+l*★(l*u)}) b=btn()if(b&gt;0)q=&hellip;(b\2%2-b%2,b\8%2-b\4%2)m=🐱(q)n=★(q)x+=m y+=n m=x+m*6n=y+n*6 🅾️(m,n,3,9)?&quot;&quot; ?p for e in all(z)do ❎,▤=x-e.x,y-e.y a=&hellip;(❎,▤)u=t()/l+r(█)e.x+=u*🐱(a)e.y+=u*★(a)?&quot;ˇ&quot;,e.x-3,e.y-2,0 if((❎/5.1)^2+(▤/5.1)^2&lt;1)stop() if(((m-e.x)/5)^2+((n-e.y)/5)^2&lt;1)del(z,e)p+=1 end?&quot;⁶1⁶c3&quot;,0,0 goto ☉--koz</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p></div></div></div></p> https://www.lexaloffle.com/bbs/?tid=142248 https://www.lexaloffle.com/bbs/?tid=142248 Mon, 13 May 2024 03:39:40 UTC Bouncy Ball <h1>Bouncy Ball</h1> <p> <table><tr><td> <a href="/bbs/?pid=145816#p"> <img src="/bbs/thumbs/pico8_bouncyball-3.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=145816#p"> bouncyball</a><br><br> by <a href="/bbs/?uid=85395"> kozm0naut</a> <br><br><br> <a href="/bbs/?pid=145816#p"> [Click to Play]</a> </td></tr></table> <br /> <strong>v3</strong> 2024-05-14:</p> <ul> <li>skarrmann hidden palette added</li> <li>increased chance of seeing secret unlockables</li> </ul> <hr /> <h1></h1> <p><em>&quot;The depressing thing about tennis is that no matter how good I get, I'll never be as good as a wall.&quot;</em><br /> <table cellpadding=0 cellspacing=8>&nbsp; &nbsp; - Mitch Hedberg</table></p> <h2>Game Guide</h2> <h3>It takes a steady paddle...</h3> <p><em>The paddle imparts its speed on the ball</em>, so <strong>keep it steady</strong> or use this to your advantage to <strong>control the ball</strong>.. if you can keep up with it!</p> <h3>Modifiers</h3> <p><strong>Modifiers</strong> will refresh along the back wall <strong>every 5 bounces</strong>. Some will give you an <strong>advantage</strong>, others a <strong>disadvantage</strong>. Be careful what you land on!</p> <ul> <li><strong>Paddle Size</strong><br /> <table cellpadding=0 cellspacing=8><tr><td valign=top> <table><tr><td width=28> <img src="https://www.lexaloffle.com/bbs/gfxc/85395_5.png" width=28 height=28> </td> <td valign=bottom> <a style="cursor:pointer;font-size:8pt" onclick=' var el = document.getElementById("gfxcode_85395_5"); if (el.style.display == "none") el.style.display = ""; else el.style.display = "none"; microAjax("https://www.lexaloffle.com/bbs/gfxc/85395_5.txt", function (retdata){ var el = document.getElementById("gfxcode_85395_5"); el.innerHTML = retdata; el.focus(); el.select(); } ); '> [7x7]</a> </td></tr> <tr><td colspan=2> <textarea rows=3 class=lexinput id="gfxcode_85395_5" style="width:640px;background-color:#fed;display:none;overflow:hidden; font-size:6pt;"></textarea> </td> </tr> </table> </td><td valign=top> <table><tr><td width=28> <img src="https://www.lexaloffle.com/bbs/gfxc/85395_6.png" width=28 height=28> </td> <td valign=bottom> <a style="cursor:pointer;font-size:8pt" onclick=' var el = document.getElementById("gfxcode_85395_6"); if (el.style.display == "none") el.style.display = ""; else el.style.display = "none"; microAjax("https://www.lexaloffle.com/bbs/gfxc/85395_6.txt", function (retdata){ var el = document.getElementById("gfxcode_85395_6"); el.innerHTML = retdata; el.focus(); el.select(); } ); '> [7x7]</a> </td></tr> <tr><td colspan=2> <textarea rows=3 class=lexinput id="gfxcode_85395_6" style="width:640px;background-color:#fed;display:none;overflow:hidden; font-size:6pt;"></textarea> </td> </tr> </table> </td></tr></table></li> <li><strong>Paddle Speed</strong><br /> <table cellpadding=0 cellspacing=8><tr><td valign=top> <table><tr><td width=28> <img src="https://www.lexaloffle.com/bbs/gfxc/85395_7.png" width=28 height=28> </td> <td valign=bottom> <a style="cursor:pointer;font-size:8pt" onclick=' var el = document.getElementById("gfxcode_85395_7"); if (el.style.display == "none") el.style.display = ""; else el.style.display = "none"; microAjax("https://www.lexaloffle.com/bbs/gfxc/85395_7.txt", function (retdata){ var el = document.getElementById("gfxcode_85395_7"); el.innerHTML = retdata; el.focus(); el.select(); } ); '> [7x7]</a> </td></tr> <tr><td colspan=2> <textarea rows=3 class=lexinput id="gfxcode_85395_7" style="width:640px;background-color:#fed;display:none;overflow:hidden; font-size:6pt;"></textarea> </td> </tr> </table> </td><td valign=top> <table><tr><td width=28> <img src="https://www.lexaloffle.com/bbs/gfxc/85395_9.png" width=28 height=28> </td> <td valign=bottom> <a style="cursor:pointer;font-size:8pt" onclick=' var el = document.getElementById("gfxcode_85395_9"); if (el.style.display == "none") el.style.display = ""; else el.style.display = "none"; microAjax("https://www.lexaloffle.com/bbs/gfxc/85395_9.txt", function (retdata){ var el = document.getElementById("gfxcode_85395_9"); el.innerHTML = retdata; el.focus(); el.select(); } ); '> [7x7]</a> </td></tr> <tr><td colspan=2> <textarea rows=3 class=lexinput id="gfxcode_85395_9" style="width:640px;background-color:#fed;display:none;overflow:hidden; font-size:6pt;"></textarea> </td> </tr> </table> </td></tr></table></li> <li><strong>Ball Speed</strong><br /> <table cellpadding=0 cellspacing=8><tr><td valign=top> <table><tr><td width=28> <img src="https://www.lexaloffle.com/bbs/gfxc/85395_10.png" width=28 height=28> </td> <td valign=bottom> <a style="cursor:pointer;font-size:8pt" onclick=' var el = document.getElementById("gfxcode_85395_10"); if (el.style.display == "none") el.style.display = ""; else el.style.display = "none"; microAjax("https://www.lexaloffle.com/bbs/gfxc/85395_10.txt", function (retdata){ var el = document.getElementById("gfxcode_85395_10"); el.innerHTML = retdata; el.focus(); el.select(); } ); '> [7x7]</a> </td></tr> <tr><td colspan=2> <textarea rows=3 class=lexinput id="gfxcode_85395_10" style="width:640px;background-color:#fed;display:none;overflow:hidden; font-size:6pt;"></textarea> </td> </tr> </table> </td><td valign=top> <table><tr><td width=28> <img src="https://www.lexaloffle.com/bbs/gfxc/85395_11.png" width=28 height=28> </td> <td valign=bottom> <a style="cursor:pointer;font-size:8pt" onclick=' var el = document.getElementById("gfxcode_85395_11"); if (el.style.display == "none") el.style.display = ""; else el.style.display = "none"; microAjax("https://www.lexaloffle.com/bbs/gfxc/85395_11.txt", function (retdata){ var el = document.getElementById("gfxcode_85395_11"); el.innerHTML = retdata; el.focus(); el.select(); } ); '> [7x7]</a> </td></tr> <tr><td colspan=2> <textarea rows=3 class=lexinput id="gfxcode_85395_11" style="width:640px;background-color:#fed;display:none;overflow:hidden; font-size:6pt;"></textarea> </td> </tr> </table> </td></tr></table></li> <li><strong>Gravity Wells</strong> (Temporary! Take care when they expire!)<br /> <table cellpadding=0 cellspacing=8><tr><td valign=top> <table><tr><td width=28> <img src="https://www.lexaloffle.com/bbs/gfxc/85395_12.png" width=28 height=28> </td> <td valign=bottom> <a style="cursor:pointer;font-size:8pt" onclick=' var el = document.getElementById("gfxcode_85395_12"); if (el.style.display == "none") el.style.display = ""; else el.style.display = "none"; microAjax("https://www.lexaloffle.com/bbs/gfxc/85395_12.txt", function (retdata){ var el = document.getElementById("gfxcode_85395_12"); el.innerHTML = retdata; el.focus(); el.select(); } ); '> [7x7]</a> </td></tr> <tr><td colspan=2> <textarea rows=3 class=lexinput id="gfxcode_85395_12" style="width:640px;background-color:#fed;display:none;overflow:hidden; font-size:6pt;"></textarea> </td> </tr> </table> </td><td valign=top> <table><tr><td width=28> <img src="https://www.lexaloffle.com/bbs/gfxc/85395_13.png" width=28 height=28> </td> <td valign=bottom> <a style="cursor:pointer;font-size:8pt" onclick=' var el = document.getElementById("gfxcode_85395_13"); if (el.style.display == "none") el.style.display = ""; else el.style.display = "none"; microAjax("https://www.lexaloffle.com/bbs/gfxc/85395_13.txt", function (retdata){ var el = document.getElementById("gfxcode_85395_13"); el.innerHTML = retdata; el.focus(); el.select(); } ); '> [7x7]</a> </td></tr> <tr><td colspan=2> <textarea rows=3 class=lexinput id="gfxcode_85395_13" style="width:640px;background-color:#fed;display:none;overflow:hidden; font-size:6pt;"></textarea> </td> </tr> </table> </td><td valign=top> <table><tr><td width=28> <img src="https://www.lexaloffle.com/bbs/gfxc/85395_14.png" width=28 height=28> </td> <td valign=bottom> <a style="cursor:pointer;font-size:8pt" onclick=' var el = document.getElementById("gfxcode_85395_14"); if (el.style.display == "none") el.style.display = ""; else el.style.display = "none"; microAjax("https://www.lexaloffle.com/bbs/gfxc/85395_14.txt", function (retdata){ var el = document.getElementById("gfxcode_85395_14"); el.innerHTML = retdata; el.focus(); el.select(); } ); '> [7x7]</a> </td></tr> <tr><td colspan=2> <textarea rows=3 class=lexinput id="gfxcode_85395_14" style="width:640px;background-color:#fed;display:none;overflow:hidden; font-size:6pt;"></textarea> </td> </tr> </table> </td><td valign=top> <table><tr><td width=28> <img src="https://www.lexaloffle.com/bbs/gfxc/85395_15.png" width=28 height=28> </td> <td valign=bottom> <a style="cursor:pointer;font-size:8pt" onclick=' var el = document.getElementById("gfxcode_85395_15"); if (el.style.display == "none") el.style.display = ""; else el.style.display = "none"; microAjax("https://www.lexaloffle.com/bbs/gfxc/85395_15.txt", function (retdata){ var el = document.getElementById("gfxcode_85395_15"); el.innerHTML = retdata; el.focus(); el.select(); } ); '> [7x7]</a> </td></tr> <tr><td colspan=2> <textarea rows=3 class=lexinput id="gfxcode_85395_15" style="width:640px;background-color:#fed;display:none;overflow:hidden; font-size:6pt;"></textarea> </td> </tr> </table> </td></tr></table></li> <li><strong>???</strong><br /> <table cellpadding=0 cellspacing=8><tr><td valign=top> <table><tr><td width=28> <img src="https://www.lexaloffle.com/bbs/gfxc/85395_16.png" width=28 height=28> </td> <td valign=bottom> <a style="cursor:pointer;font-size:8pt" onclick=' var el = document.getElementById("gfxcode_85395_16"); if (el.style.display == "none") el.style.display = ""; else el.style.display = "none"; microAjax("https://www.lexaloffle.com/bbs/gfxc/85395_16.txt", function (retdata){ var el = document.getElementById("gfxcode_85395_16"); el.innerHTML = retdata; el.focus(); el.select(); } ); '> [7x7]</a> </td></tr> <tr><td colspan=2> <textarea rows=3 class=lexinput id="gfxcode_85395_16" style="width:640px;background-color:#fed;display:none;overflow:hidden; font-size:6pt;"></textarea> </td> </tr> </table> </td></tr></table></li> <li><strong>Secret Unlockables?????</strong><br /> <table cellpadding=0 cellspacing=8><tr><td valign=top> <table><tr><td width=28> <img src="https://www.lexaloffle.com/bbs/gfxc/85395_18.png" width=28 height=28> </td> <td valign=bottom> <a style="cursor:pointer;font-size:8pt" onclick=' var el = document.getElementById("gfxcode_85395_18"); if (el.style.display == "none") el.style.display = ""; else el.style.display = "none"; microAjax("https://www.lexaloffle.com/bbs/gfxc/85395_18.txt", function (retdata){ var el = document.getElementById("gfxcode_85395_18"); el.innerHTML = retdata; el.focus(); el.select(); } ); '> [7x7]</a> </td></tr> <tr><td colspan=2> <textarea rows=3 class=lexinput id="gfxcode_85395_18" style="width:640px;background-color:#fed;display:none;overflow:hidden; font-size:6pt;"></textarea> </td> </tr> </table> </td><td valign=top> <table><tr><td width=28> <img src="https://www.lexaloffle.com/bbs/gfxc/85395_18.png" width=28 height=28> </td> <td valign=bottom> <a style="cursor:pointer;font-size:8pt" onclick=' var el = document.getElementById("gfxcode_85395_18"); if (el.style.display == "none") el.style.display = ""; else el.style.display = "none"; microAjax("https://www.lexaloffle.com/bbs/gfxc/85395_18.txt", function (retdata){ var el = document.getElementById("gfxcode_85395_18"); el.innerHTML = retdata; el.focus(); el.select(); } ); '> [7x7]</a> </td></tr> <tr><td colspan=2> <textarea rows=3 class=lexinput id="gfxcode_85395_18" style="width:640px;background-color:#fed;display:none;overflow:hidden; font-size:6pt;"></textarea> </td> </tr> </table> </td><td valign=top> <table><tr><td width=28> <img src="https://www.lexaloffle.com/bbs/gfxc/85395_18.png" width=28 height=28> </td> <td valign=bottom> <a style="cursor:pointer;font-size:8pt" onclick=' var el = document.getElementById("gfxcode_85395_18"); if (el.style.display == "none") el.style.display = ""; else el.style.display = "none"; microAjax("https://www.lexaloffle.com/bbs/gfxc/85395_18.txt", function (retdata){ var el = document.getElementById("gfxcode_85395_18"); el.innerHTML = retdata; el.focus(); el.select(); } ); '> [7x7]</a> </td></tr> <tr><td colspan=2> <textarea rows=3 class=lexinput id="gfxcode_85395_18" style="width:640px;background-color:#fed;display:none;overflow:hidden; font-size:6pt;"></textarea> </td> </tr> </table> </td></tr><tr><td valign=top><strong>...??</strong></td></tr></table></li> </ul> <h2>Demo Mode</h2> <p><em>Bouncy Ball</em> includes a self-playing demo mode. Unlock up to <strong>4 CPU demo skill levels</strong> by playing!</p> <h2>Thanks to the PICO-8 community!</h2> <p>Big heartfelt thanks to <a href="https://www.lexaloffle.com/bbs/?uid=1"> @zep</a> for making this wonderfully fun tool!<br /> Credit for nice smooth circles goes to <a href="https://www.lexaloffle.com/bbs/?uid=16330"> @2darray</a>: <code>aacirc()</code> is used from <a href="https://www.lexaloffle.com/bbs/?pid=136646">Marble Merger</a>.<br /> Thanks to everyone on the BBS and Discord for harboring such an amazing community!</p> <p>This is my first PICO-8 game release, and my second complete game release overall. I tried desperately to keep it as simple as possible in order to actually bring it to completion. As such, the game is <strong>only 4 colors!</strong>...</p> <p>...However, there <em>may or may not</em> be <strong>additional palettes</strong> included as hidden unlockables within the game...</p> <p><strong>Suggest a suitable (reasonable contrast) 4-color palette in the comments and I may just include it as a rare unlockable option, along with your name!</strong></p> <hr /> <h3>High Scores</h3> <ol> <li><strong>49</strong> skarrmann</li> </ol> https://www.lexaloffle.com/bbs/?tid=141469 https://www.lexaloffle.com/bbs/?tid=141469 Fri, 05 Apr 2024 17:45:38 UTC One-line minimap <p>This is pretty simple but I thought some devs might find it useful as an easy way to add a minimap to your game. It uses <code>tline</code> to draw a miniature version of the full map area to screen (during your _draw loop):</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>for i=0,64 do tline(0,32+i,128,32+i,4/8,4/8+i,1) end</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>The representative pixel is drawn from the center (4/8,4/8) of each sprite, but you can alter this if you want a different selection.</p> <p>Here's an example of what this looks like in <a href="https://www.lexaloffle.com/bbs/?tid=2145">Celeste</a>:</p> <img style="margin-bottom:16px" border=0 src="/media/85395/celeste 1 0 fixed for p8 v0 1 2 _0.png" alt="" /> <p>And here's <a href="https://www.lexaloffle.com/bbs/?tid=52598">Air Delivery</a> with this line added:</p> <img style="margin-bottom:16px" border=0 src="/media/85395/air delivery_0.png" alt="" /> <p>Obviously it can be a bit messy raw, but it's accurate. For your own project, you could put this against a solid background color in your pause menu, for example. And then you might add an indicator for player position ;)</p> <p>I hope this can be useful out there!</p> https://www.lexaloffle.com/bbs/?tid=140478 https://www.lexaloffle.com/bbs/?tid=140478 Sat, 02 Mar 2024 19:38:00 UTC Tweetcart: Shimmerscale <h1>Shimmerscale</h1> <img style="margin-bottom:16px" border=0 src="/media/85395/shimmerscale_2.gif" alt="" /> <p>NOW IN GLORIOUS <strong>QUADRACOLOR</strong></p> <p>Consuming 239 chars because I didn't bother to minify further:</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(13)s=sin a=12b=4 ::_:: t=time()/4 for i=0,36 do for j=0,42 do r=(i+1.4*j)/64 m=12*s(t+r) x=-8+4*i+3.4*s(t+r-.25) y=-20+4*j+8*s(r) if(btn(❎))a=11b=5 if(btn(🅾️))a=12b=4 o=a+(i/3+j/3+t*16)%b line(x,y-m,x+1,y-m+s(t+r+.75),o) end end goto _</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>Press ❎ to activate <strong>CHROMATOSIS:</strong><br /> <em>An experimental bleeding-edge 5-color mode</em></p> <img style="margin-bottom:16px" border=0 src="/media/85395/shimmerscale p8_2.gif" alt="" /> <h3>Feel free to use/modify this effect for your projects!</h3> <p><code>a</code> is the starting color and <code>b</code> is how many subsequent colors in the palette to use, so you can alter this to use any colors you want using <code>pal({})</code> and those two variables. Note that the effect relies on not using <code>cls()</code> so this would be best suited to a splash screen or menu, or for use with <code>clip()</code></p> <img style="margin-bottom:16px" border=0 src="/media/85395/colorwave_5.gif" alt="" /> <p>*<em>angle also slightly modified for this example</em></p> https://www.lexaloffle.com/bbs/?tid=139933 https://www.lexaloffle.com/bbs/?tid=139933 Mon, 22 Jan 2024 19:12:11 UTC Tweetcart: Fire Dance <p>I've been working on a little tweetcart so that I might have something to actually release while still at work on more ambitious projects.</p> <p><span style="text-decoration: line-through;">I was able to get it down to 272 chars</span>. It runs at 60fps.</p> <p><strong>Edit</strong>: Used up the last few characters fixing a bug, refining the decay and adding some slight interactivity. Some chars can probably be reclaimed by combining the loops somehow (and using goto instead) but I'll probably just leave it at this.</p> <p>It starts slow and continues building over time. Enjoy!</p> <img style="margin-bottom:16px" border=0 src="/media/85395/tc280_fire p8_1.gif" alt="" /> <p> <table><tr><td> <a href="/bbs/?pid=139821#p"> <img src="/bbs/thumbs/pico8_tc_firedance-2.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=139821#p"> tc_firedance</a><br><br> by <a href="/bbs/?uid=85395"> kozm0naut</a> <br><br><br> <a href="/bbs/?pid=139821#p"> [Click to Play]</a> </td></tr></table> </p> https://www.lexaloffle.com/bbs/?tid=55673 https://www.lexaloffle.com/bbs/?tid=55673 Mon, 08 Jan 2024 16:39:10 UTC