pootie [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=45478 Boomshine <p> <table><tr><td> <a href="/bbs/?pid=103061#p"> <img src="/bbs/thumbs/pico8_yugiwohen-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=103061#p"> Boomshine v0.3</a><br><br> by <a href="/bbs/?uid=45478"> pootie</a> <br><br><br> <a href="/bbs/?pid=103061#p"> [Click to Play]</a> </td></tr></table> </p> <p>This is a remake of an old Flash game I used to enjoy.<br /> Here's an URL to the Author's Boomshine page: <a href="https://k2xl.com/#/games/boomshine">https://k2xl.com/#/games/boomshine</a></p> <p>Anyway, one of the best things about the game was the music, but I struggle with the sound/music part. So, if anyone wants to create the music that would be great! Here's a working version of the game online (I'm assuming it's some kind of Flash emulator): <a href="https://www.addictinggames.com/strategy/boomshine">https://www.addictinggames.com/strategy/boomshine</a></p> <p>Also, my sound effects are pretty crappy too.</p> <p>Another thing that bothers me is how much the game slows down once we reach 40 balls at the screen at a time. I've gone over everything and I've narrowed it down to the following function.</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>-- distance function distance(obj1,obj2) return ((obj2.x-obj1.x)^2+(obj2.y-obj1.y)^2)^0.5 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>It's just finding and returning the distance between two points, but of course I have to compare every ball with every other ball so I guess it adds up. If I comment out the logic in that function (and just return a value), the slowdown doesn't occur (even at 60 balls). It looks like some pretty simple math for it to cause so much trouble.</p> <p>Anyway, thanks for checking it out and any feedback would be great!</p> <p>Edit: Oops, I forgot to add the score.<br /> Edit 2: Oops, I forgot the Author's URL.</p> https://www.lexaloffle.com/bbs/?tid=45743 https://www.lexaloffle.com/bbs/?tid=45743 Sat, 18 Dec 2021 18:29:43 UTC BFS and Memory <p>I'm trying to use a breadth-first search on a grid for path finding. My code works for a grid of 7x7, and just barley for 8x8, but it runs out of memory at 9x9. I was just wondering if there was a way I could do things differently to keep the memory usage down.</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>function grid:findpath(src,dest) function buildpath(node) local path={} local current=node while current do add(path,current,1) current=current.parent end return path end local dirs={ {x=-1,y=0}, {x=1,y=0}, {x=0,y=-1}, {x=0,y=1} } src.parent=nil local queue={} local visited={} for y=1,grid_size do local row={} for x=1,grid_size do add(row,false) end add(visited,row) end add(queue,src) while #queue&gt;0 do local node=deli(queue,1) visited[node.y][node.x]=true if node.x==dest.x and node.y==dest.y then return buildpath(node) end for dir in all(dirs) do local new_node={ parent=node, x=node.x+dir.x, y=node.y+dir.y } if new_node.x&gt;0 and new_node.y&gt;0 and new_node.x&lt;=grid_size and new_node.y&lt;=grid_size and visited[new_node.y][new_node.x]==false and self[new_node.y][new_node.x]==0 then add(queue,new_node) end end 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>Thanks</p> https://www.lexaloffle.com/bbs/?tid=45421 https://www.lexaloffle.com/bbs/?tid=45421 Sun, 21 Nov 2021 05:08:38 UTC Mastermind <p>Just the old Mastermind board game redone in PICO-8.<br /> I got the music from Robby Duguay (Thanks Robby!): <a href="https://www.lexaloffle.com/bbs/?tid=2619">https://www.lexaloffle.com/bbs/?tid=2619</a></p> <p>Feel free to let me know about bugs and such.</p> <p>Edit: New version with bug fix and changes as per comments.</p> <p> <table><tr><td> <a href="/bbs/?pid=99469#p"> <img src="/bbs/thumbs/pico8_dejutunud-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=99469#p"> Mastermind (v0.2)</a><br><br> by <a href="/bbs/?uid=45478"> pootie</a> <br><br><br> <a href="/bbs/?pid=99469#p"> [Click to Play]</a> </td></tr></table> </p> https://www.lexaloffle.com/bbs/?tid=45215 https://www.lexaloffle.com/bbs/?tid=45215 Mon, 01 Nov 2021 16:35:32 UTC MAP Question <p>I've run into the same thing on a couple of projects, so I'm wondering if I'm missing something in regards to map().</p> <ul> <li>sprites have flags marked 0-7</li> <li>the map command has the optional argument 'layer' that will display only sprites of a certain flag</li> <li>the default argument for layer is 0, which mean to show everything</li> <li>if I mark a sprite with flag 0, then using 0 as the argument will just show everything (which isn't what I want)</li> </ul> <p>I think in the past I just didn't make use of flag 0 and it looks like that's what Zep did with Jelpi, but it seems odd that I can't (I think) use flag 0 as a layer argument.</p> <p>Thanks</p> https://www.lexaloffle.com/bbs/?tid=43935 https://www.lexaloffle.com/bbs/?tid=43935 Sat, 24 Jul 2021 15:55:07 UTC Limitations / Workarounds? <p>So, I was in love with PICO-8 while making a game, but then I ran out of tokens. So, I tried a few techniques to optimize my code but it became clear that I wasn't going to be able to fit everything I had planned. So, I just posted the game with some significant content removed.</p> <p>Some people have reported bugs here and there, but when I go to fix them I end up running out of tokens just to do my debugging (i.e.adding extra keyboard input for testing purposes).</p> <p>I get, and enjoyed, the idea of having strict limitations, but hitting the token limit just ruined the experience for me. Even if I could just go outside of its limitations just for the testing process, that would be great. I know it's part of the charm of PICO-8, but the token limit (at least) has kinda killed the fun for me.</p> <p>Does anyone else know of any tricks for this? Does anyone else feel the same way?</p> <p>Thanks.</p> https://www.lexaloffle.com/bbs/?tid=39181 https://www.lexaloffle.com/bbs/?tid=39181 Tue, 11 Aug 2020 23:02:15 UTC Kung Fu demake <p> <table><tr><td> <a href="/bbs/?pid=79455#p"> <img src="/bbs/thumbs/pico8_kung_fu_demake-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=79455#p"> Kung Fu (demake)</a><br><br> by <a href="/bbs/?uid=45478"> pootie</a> <br><br><br> <a href="/bbs/?pid=79455#p"> [Click to Play]</a> </td></tr></table> </p> <p>A demake of Kung Fu for the NES. It was called &quot;Kung Fu Master&quot; in the arcades in the 80s.</p> https://www.lexaloffle.com/bbs/?tid=38871 https://www.lexaloffle.com/bbs/?tid=38871 Thu, 16 Jul 2020 21:32:31 UTC Lua OOP <p>I'm loving PICO-8 with one exception: I'm not crazy about Lua. I've read the Lua documentation for OOP, but the table thing is so different and I can't find examples for what I'm trying to do.</p> <p>I'm almost finished something I'm working on, but the larger the program gets the more I miss being able to separate the logic into objects (the way I'm used to anyway).</p> <p>Long story short, I wanted to do the following:</p> <p>Entity Class:</p> <ul> <li>x, y, width, height, speed, etc</li> <li>function update()</li> <li>function draw()</li> </ul> <p>Player Class(that inherits from the entity class):</p> <ul> <li>score, weapon, power, etc</li> <li>function update(overrides but calls super function from entity)</li> <li>function draw(same)</li> </ul> <p>Enemy Class(that inherits from the entity class):</p> <ul> <li>extra variables</li> <li>overridden functions calling super functions Entity class</li> </ul> <p>SpecialEnemy Class(that inherits from Enemy/and then from Entity obviously)</p> <ul> <li>extra variables</li> <li>overridden functions calling super functions from Enemy class</li> </ul> <p>I hope that makes sense. It looks like Lua doesn't really have a natural way to do multiple inheritance. Anyway, does anyone have any tips for how to implement something like this? Right now, I everything is just procedural.</p> <p>Thanks.</p> https://www.lexaloffle.com/bbs/?tid=38694 https://www.lexaloffle.com/bbs/?tid=38694 Mon, 06 Jul 2020 00:14:26 UTC