donbattery [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=86583 Pocket Platoon <p> <table><tr><td> <a href="/bbs/?pid=169226#p"> <img src="/bbs/thumbs/pico8_pplatoon-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=169226#p"> Pocket Platoon</a><br><br> by <a href="/bbs/?uid=86583"> donbattery</a> <br><br><br> <a href="/bbs/?pid=169226#p"> [Click to Play]</a> </td></tr></table> </p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/86583/screenshot_0.gif" alt="" /> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/86583/screenshot_4.gif" alt="" /> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/86583/screenshot_5.gif" alt="" /> <h1>A party game for up to 4 buddies</h1> <p>This game features:</p> <ul> <li>Local multiplayer for 4 players </li> <li>3 game modes (PvE, PvP and PvPvE) </li> <li>Infinite random generated maps (3 different planes: Earth, Void and Ruins with 9 possible color schemes) </li> <li>Pixel perfect terrain destruction </li> <li>2 power-ups (Med Kit and Weapon Box) </li> <li>2 traps (Land Mine and Acid Barrel) </li> <li>10 unique weapons </li> <li>melee combat </li> <li>techno squids </li> </ul> <h2>Controls</h2> <ul> <li>Player1 and Player2 can share a keyboard </li> <li>Player1 - Player4 can use any SDL compatible gamepad / controller with at least 6 buttons </li> </ul> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/86583/controls.png" alt="" /> <ul> <li>Move horizontally with <strong>Left</strong> and <strong>Right</strong></li> <li>Use your jetpack with <strong>O</strong></li> <li>Aim in 8 directions, shoot with <strong>X</strong></li> <li>If the end of your weapon is inside a wall, <strong>X</strong> performs a wall-punch</li> <li>If you, or the end of your weapon is touching another object, <strong>X</strong> performs a melee attack</li> </ul> <h2>Objects</h2> <p><strong>Med Kit</strong><br /> Every soldier has 10 HP by default. You can only pick up a Med Kit when your HP is below 10. Picking up a Med Kit will restore your HP to 10. </p> <p><strong>Weapon Box</strong><br /> You get a Pistol by default. Picking up a Weapon Box will change your weapon to a random weapon which is not a Pistol, and not the one you are currently carrying. </p> <p><strong>Land mine</strong><br /> Stepping on a Land Mine will activate it </p> <p><strong>Acid Barrel</strong><br /> Watch out for Acid Barrels! </p> <p><strong>Techno Squid (Weapon: Lazer Melee: Cyber Tentacles)</strong><br /> Vicious machine spirit risen from the radioactive ruins of civilization, hunting for the remains of life to destroy </p> <h2>Main Menu</h2> <ul> <li>Players can join at any stage of the game, by pressing either <strong>O</strong> or <strong>X</strong></li> <li>After each battle, all players are disconnected, and needs to re-connect for the next battle</li> <li>Once connected, navigate in the menu with <strong>Up</strong> and <strong>Down</strong></li> <li>Select menu options with <strong>Left</strong> and <strong>Right</strong></li> <li>Submit the menu with <strong>O</strong> or <strong>X</strong> </li> </ul> <p><strong>Mode</strong> controls the game mode: </p> <ul> <li><strong>War</strong> is the PvE mode - there is no friendly fire</li> <li><strong>Arena</strong> is the PvP mode - there are no techno squids</li> <li><strong>Chaos</strong> is the PvPvE mode - everyone is for themselves, and soldier kills scores you 2 points</li> </ul> <p><strong>Time</strong> sets the length of the battle in minutes </p> <p><strong>Boxes</strong> controls the amount of Med Kits and Weapon Boxes spawned<br /> <strong>Traps</strong> controls the amount of Land Mines and Acid Barrels spawned<br /> <strong>Bots</strong> controls the strength of the invading machine forces<br /> <strong>Enter the Wastelands</strong> will open the Map Menu </p> <h2>Map Menu</h2> <ul> <li>Pressing <strong>O</strong> or <strong>X</strong> on any menu option will generate a new map with the current settings</li> <li><strong>Density</strong> controls the air/wall ratio</li> <li><strong>Shape</strong> controls how open the map is</li> <li><strong>Fabric</strong> controls the strength of the map, each plane has 3 color schemes</li> <li><strong>Terraform</strong> will just generate a new map</li> <li><strong>Enter the Battle</strong> will generate a new map if there is none, and <strong>start the game</strong></li> <li><strong>Back to Base</strong> will bring us back to the Main Menu</li> </ul> <h2>In Game</h2> <ul> <li>Race against time to collect as much points as possible</li> <li>Killing a soldier or a techno squid will score you one point</li> <li>In War mode you cannot kill other soldiers</li> <li>In Arena mode there are no techno squids</li> <li>In Chaos mode a soldier kill scores you 2 points</li> <li>If a techno squid, a Land Mine or an Acid Barrel kills you, you lose one point</li> <li>You also lose one point if you kill yourself</li> <li>If you die, you respawn in three seconds</li> </ul> <h2>Arsenal</h2> <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>Weapon Damage Burst Magazine Fire-rate Reload-time Pistol 2.8 - 3.2 1 8 2.72 1.5 Knife 6 - 9 1 1 1.3 0.75 Bolter 0.9 - 1.1 1 35 10 2 Shotgun 0.9 - 1.3 5 5 2 1.83 Lazerifle 6 - 7 1 4 2.4 1.83 Rocketeer 7 - 8 1 1 0.5 2 Flamer 0.5 - 0.8 3 50 6 1.6 Granadeer 4 - 6 1 5 1 2 Orber 2 - 3 1 1 1 1 Molter 2.5 - 3 3 3 2 1.25</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>Knife can be thrown and stick to the ground, your melee attacks deals 3X damage, when you are carrying a knife</li> <li>Rockets will lock on the first available target in sight</li> <li>Flames has a chance to burn trough terrain</li> <li>Grenades are bouncing off the terrain</li> <li>Orber blobs are going trough terrain, dealing additional area damage</li> <li>Molter blobs are sticking to the terrain, and detonate over time</li> </ul> <h2>Credits</h2> <p>First of all I would like to thank <strong>zep</strong> for creating PICO-8!</p> <p>I would also like to thank <strong>Gruber Jam</strong> for composing the music <a href="https://www.lexaloffle.com/bbs/?tid=52127">Space Lizards</a> and making it royalty free! Although this is a really catchy chip-tune, it can get repetitive over some time. You can turn off the music separately from the sound, in the PICO-8 pop-up menu.</p> <p>I would like to thank the PICO-8 community (here, on YouTube, on Reddit, on Discord) for providing learning-materials, tutorials, snippets, tips and tricks.</p> <p>Special thanks to BeastPete for developing the original idea with me.</p> <p>the game is also available on <a href="https://donbattery.itch.io/pocket-platoon">itch.io</a></p> https://www.lexaloffle.com/bbs/?tid=149841 https://www.lexaloffle.com/bbs/?tid=149841 Fri, 27 Jun 2025 09:55:09 UTC simple terminal implementation <p>A simple terminal implementation for 251 tokens (I'm pretty sure you can find some clever ways to reduce this), for your dev tools.</p> <p>Currently I'm working on some editors for my game, I had to implement mouse controls, buttons and layout. However I have missed a crucial part: text input.</p> <p>I have looked inside the community wiki and found out how to read the keyboard buffer. I have made this simple terminal which I'm really satisfied with, and I thought maybe it is worth to share. Nothing fancy just a shell ready to interpret whatever command you type in and hit enter.</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 new_terminal(text_color, bg_color, error_color) local t = {} t.history, t.buffer, t.t_col, t.bg_col, t.err_col, t.commands, t.append, t.render = {}, &quot;&quot;, text_color or 11, bg_color or 0, error_color or 8, { cls = function(_ENV) history = {} end }, function(_ENV, str, err) for line in all(split(tostr(str), &quot;\n&quot;)) do add(history, { s = line, c = err and err_col or t_col }, 1) end end, function(_ENV, x, y, h) -- while there is a character in the keyboard buffer while stat(30) do -- read the next character local c = stat(31) -- backspace if c == &quot;\b&quot; then buffer = sub(buffer, 1, #buffer - 1) -- enter elseif c == &quot;\r&quot; then -- prevent pico-8's pop-up window poke(0x5f30, 1) append(_ENV, buffer) local parts = split(buffer, &quot; &quot;) buffer = &quot;&quot; local p1 = parts[1] if p1 ~= &quot;&quot; then if commands[p1] then local res, code = commands[p1](_ENV, parts) if (res) append(_ENV, res, code) else append(_ENV, &quot;unknown command: &quot; .. p1, 1) end end else buffer = buffer .. c end end rectfill(x, y, 127, y + h * 6, bg_col) -- you can remove these but then the terminal will look a bit ugly x += 1 y += 1 local lines = min(#history, h - 1) for i = lines, 1, -1 do print(history[i].s, x, y + (lines - i) * 6, history[i].c) end print(&quot;&gt;&quot; .. buffer .. &quot;_&quot;, x, y + lines * 6, t_col) end return setmetatable(t, { __index = _ENV }) end -- example usage function _init() -- turn on the dev kit so we can access the keyboard poke(0x5f2d, 0x1) term = new_terminal() -- attach a command to the terminal term.commands.hello = function(_ENV, args) return &quot;hello&quot; .. (args[2] and &quot; &quot; .. args[2] or &quot;&quot;) .. &quot;!&quot; end -- attach a command with multiline results term.commands.ls = function() return &quot;a\nb\nc&quot; end -- attach a command with possible error results term.commands.ok = function(_ENV, args) local ok = rnd() &lt; .5 return ok and &quot;success&quot; or &quot;error&quot;, not ok end end function _draw() cls(1) -- draw the terminal starting from y, y with height in rows (each row is 6 pixel tall) -- the terminal always spans to the right edge of the screen term:render(0, 22, 10) end </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> https://www.lexaloffle.com/bbs/?tid=148172 https://www.lexaloffle.com/bbs/?tid=148172 Tue, 01 Apr 2025 09:53:00 UTC