nef0510 [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=25467 Neon Shooter <p> <table><tr><td> <a href="/bbs/?pid=52510#p"> <img src="/bbs/thumbs/pico52509.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=52510#p"> Neon Shooter</a><br><br> by <a href="/bbs/?uid=25467"> nef0510</a> <br><br><br> <a href="/bbs/?pid=52510#p"> [Click to Play]</a> </td></tr></table> </p> <p>I've submitted this cartridge to the WIP section because it is not finished, it does not have sound and it starts lagging like crazy after a minute. I would appreciate it if someone could tell me a way to store a table with the bullets and remove them once they are no longer visible. I have tried using the DEL() function, but it just changes a value into nil, which bugs the code.</p> <p>How are the bullets stored in a table?</p> <p>This is pretty much the way they are stored:</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> if btn(4) then -- storing the X so it stays there add(bullets, player_x) -- storing the Y, so it can be changed add(bullets, 100) 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>And this is how the table is read:</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=1, #bullets do if i % 2 == 0 then -- change the y so that they go up bullets[i-1] -= 2 end 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>So I really need help finding a better way to store them and removing the unnecessary bullets.</p> https://www.lexaloffle.com/bbs/?tid=31249 https://www.lexaloffle.com/bbs/?tid=31249 Mon, 07 May 2018 16:02:23 UTC Drawing(click me) <p> <table><tr><td> <a href="/bbs/?pid=43483#p"> <img src="/bbs/thumbs/pico43482.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=43483#p"> Drawing 1.0</a><br><br> by <a href="/bbs/?uid=25467"> nef0510</a> <br><br><br> <a href="/bbs/?pid=43483#p"> [Click to Play]</a> </td></tr></table> <br /> This is my first thing I've made with Pico-8. Press Z/click to add a circle, and press X to clear.</p> <p>How it works:</p> <p>For every time you draw a circle it adds the X and Y of it to a table. Then, in the draw function, all circles in the table are rendered. I thought it was interesting how this rendered the circles so I published it for everyone to see.</p> https://www.lexaloffle.com/bbs/?tid=29823 https://www.lexaloffle.com/bbs/?tid=29823 Sun, 20 Aug 2017 10:37:43 UTC