evn [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=13932 Spinny game. Looking for constructive criticism <p>I repurposed one of my tweettweetcarts into this little 2 player game. The gameplay is finished I think but visually it feels like something is missing. I have plans to add a title screen and cover art. Any suggestions or constructive criticism would be appreciated! :</p> <h3>Chomp</h3> <p>Chomp 10 coins fast!</p> <p><strong>Controls:</strong><br /> P1: arrow keys <em>or</em> x, o <em>or</em> gamepad1<br /> P2: ESDF <em>or</em> Lshift, A <em>or</em> gamepad2</p> <p>Credits:<br /> Music by snabisch<br /> Sound effects by Gruber<br /> Sprites by ivoryred, Kicked-in-Teeth, and Ironchest Games</p> <p><a href="https://evn.itch.io/chomp"><strong>This game is also on itch.io</strong></a></p> <p> <table><tr><td> <a href="/bbs/?pid=158359#p"> <img src="/bbs/thumbs/pico8_evn_chomp_v1_0-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=158359#p"> Evn's Chomp v1.0</a><br><br> by <a href="/bbs/?uid=13932"> evn</a> <br><br><br> <a href="/bbs/?pid=158359#p"> [Click to Play]</a> </td></tr></table> </p> https://www.lexaloffle.com/bbs/?tid=145774 https://www.lexaloffle.com/bbs/?tid=145774 Wed, 27 Nov 2024 16:43:00 UTC DELI(V,I) only works on int indexes <p>According to the <a href="https://www.lexaloffle.com/pico-8.php?page=manual">PICO-8 0.2.2c manual</a>, &quot;To remove an item at a particular index, use deli&quot;<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> <p> del t v</p> <p> Delete the first instance of value v in table t<br /> The remaining entries are shifted left one index to avoid holes.<br /> Note that v is the value of the item to be deleted, not the index into the table.<br /> (To remove an item at a particular index, use deli instead)<br /> del returns the deleted item, or returns no value when nothing was deleted.</p> <p> A={1,10,2,11,3,12}<br /> FOR ITEM IN ALL(A) DO<br /> IF (ITEM &lt; 10) THEN DEL(A, ITEM) END<br /> END<br /> FOREACH(A, PRINT) -- 10,11,12<br /> PRINT(A[3]) -- 12</p> <p> deli t [i]</p> <p> Like del(), but remove the item from table t at index i.<br /> When i is not given, the last element of the table is removed and returned.</p> <p></div></div></div><br /> However, this does not seem to work with string or float indices. (Only tested on macOS Mojave)<br /> The desired result can be achieved using</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>t[i] = nil</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>which <a href="https://stackoverflow.com/a/1759017/">seems to be the accepted way</a> in lua.<br /> Possible resolutions:</p> <ul> <li>Update deli(t,i) to work with all index types</li> <li>Update PICO-8 manual to specify deli only works with integer indices, and include t[i]=nil workaround.</li> </ul> <p>thank you :)</p> https://www.lexaloffle.com/bbs/?tid=42109 https://www.lexaloffle.com/bbs/?tid=42109 Sun, 21 Mar 2021 03:16:52 UTC