Mot [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=39676 Air Pico <p> <table><tr><td> <a href="/bbs/?pid=167867#p"> <img src="/bbs/thumbs/pico8_mot_airpico-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=167867#p"> Air Pico</a><br><br> by <a href="/bbs/?uid=39676"> Mot</a> <br><br><br> <a href="/bbs/?pid=167867#p"> [Click to Play]</a> </td></tr></table> </p> <p><strong>UPDATE: Now with mouse support. Enable from the pause menu.</strong></p> <p><em>A cozy flight sim lite for PICO-8.</em></p> <p>Become a pilot for <strong>Pico Air</strong>, a small air company operating between the islands of Pico Isles.<br /> Perform deliveries, charter flights, crop dusting and other jobs to unlock new planes.</p> <p>Features:</p> <ul> <li>A 16km x 16km map to explore</li> <li>3 different planes</li> <li>External camera views</li> <li>Photo mode</li> </ul> <h3>Controls</h3> <ul> <li>Arrows - Ailerons and elevator (roll and pitch)</li> <li>O + Up/Down - Throttle</li> <li>O + Left/Right - Rudder</li> <li>X + Up/Down - Adjust elevator trim</li> <li>X + Left/Right - Flaps</li> </ul> <p>Or use player 2 controls for throttle and rudder.</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/mot_airpicogame_1.png" alt="" /> <p>Dashboard instruments from left to right are:</p> <ul> <li>Speed in knots</li> <li>Height in feet</li> <li>Vertical speed in feet per minute</li> <li>Flaps</li> <li>Throttle</li> </ul> <h3>Photo mode</h3> <p>During a mission or free flight you can select &quot;Photo mode&quot; from the PICO-8 pause menu.<br /> Photo mode allows pauses the game and allows you to move the camera independently from the plane.</p> <p>During photo mode:</p> <ul> <li>Arrows - Turns the camera</li> <li>Player 2 arrows - Moves the camera</li> <li>X (hold) - Move slowly</li> <li>O (hold) - Move quickly</li> <li>X+O (hold) - Move very quickly</li> </ul> <p>Select &quot;Back to game&quot; from the pause menu to exit photo mode and return to the game.</p> <h3>Pico Isles</h3> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/placenames.png" alt="" /> https://www.lexaloffle.com/bbs/?tid=149301 https://www.lexaloffle.com/bbs/?tid=149301 Sat, 31 May 2025 09:51:53 UTC Find sfx not used by music patterns <p>Just a little snippet I use when looking sfx that haven't been used in the pattern editor.</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>p,s={},&quot;&quot; for a=0x3100,0x31ff do p[@a]=true end for i=0,63 do if not p[i] then s..=i..&quot; &quot; end end print(s)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>Paste into the terminal and hit enter.</p> <p><strong>WARNING</strong>: This <em>only</em> shows sfx that are unused in any pattern. <em>You</em> are responsible for checking whether they are:</p> <ul> <li>Used as sfx in the program</li> <li>Used as instruments by another sfx (i.e. for sfx 0 to 7)</li> <li>Used in some other way I haven't thought of</li> </ul> https://www.lexaloffle.com/bbs/?tid=149270 https://www.lexaloffle.com/bbs/?tid=149270 Fri, 30 May 2025 01:52:42 UTC Experimental Flight Sim <p> <table><tr><td> <a href="/bbs/?pid=165852#p"> <img src="/bbs/thumbs/pico8_mot_flightsim-7.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=165852#p"> mot_flightsim</a><br><br> by <a href="/bbs/?uid=39676"> Mot</a> <br><br><br> <a href="/bbs/?pid=165852#p"> [Click to Play]</a> </td></tr></table> </p> <p>This is a work-in-progress flight simulator I've been working on.</p> <p>The flight model is mostly implemented, but may need some tweaking. And I'm still to implement crashing into buildings and some sort of map or navigation aid.</p> <p>I've never flown a plane, and only dabbled in flight sims, so I would <em>really</em> appreciate some feedback from anyone with more experience than me, so I can try to tweak the flight model parameters to be a bit more realistic.</p> <p>The plane is based on the Cessna 172.</p> <h3>Controls</h3> <ul> <li>Arrows - ailerons/elevators</li> <li>Player 2 up/down (E,D) - throttle</li> <li>Player 2 left/right (S,F) - rudder</li> </ul> <p>While holding down X</p> <ul> <li>Up/down - adjust trim</li> <li>Left/right - adjust flaps</li> </ul> <p>You can also control it with a single controller by holding down circle to switch from ailerons/elevators to throttle/rudder.</p> <p>When on the ground:</p> <ul> <li>Dropping the throttle to 0 and continuing to press down activates the wheel brakes.</li> <li>The rudder controls also control the nose wheel when your speed is less than 10 knots.</li> </ul> <h3>Instruments</h3> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/plane2_40.png" alt="" /> <p>From left to right the instruments/controls are:</p> <ol> <li>Airspeed in knots</li> <li>Altitude in feet</li> <li>Vertical speed in feet per minute</li> <li>Flaps</li> <li>Throttle</li> </ol> <h3>Taking off</h3> <ol> <li>Leave flaps set to 0 (i.e. the default)</li> <li>Set the throttle to full</li> <li>Wait until the plane speed reaches 55 knots</li> <li>Pull back slightly (down arrow) to raise the nose</li> </ol> <h3>Landing</h3> <ol> <li>Aim to approach at 4.5 degree glide slope and 65 knots.</li> <li>Each airport has a coloured glideslope light: <ul> <li>yellow = too high</li> <li>green = in range</li> <li>red = too low</li> </ul></li> <li>Once you reach the runway:<br /> a. level off at 10 feet above ground.<br /> b. Try to slowly descend to 5 feet.<br /> c. Drop the throttle to 0<br /> d. Try to fly just above the runway for as long as possible until gravity takes over</li> </ol> <p>(This is admittedly easier said than done with Pico-8 controls :-)</p> <h3>Aircraft damage</h3> <p>These things will damage the aircraft:</p> <ul> <li>Heavy landings/crashes</li> <li>Exceeding &quot;never exceed speed&quot; (158 knots)</li> <li>Tight turns when exceeding &quot;design maneuvering speed&quot; (97 knots)</li> <li>Taxiing on the wrong surface types</li> </ul> <h3>Flight model</h3> <p>If the game feels difficult, you can change the flight model in the pause menu.<br /> &quot;simple&quot; disables stalls and damage due to stressing the airframe at high speeds.<br /> &quot;easy&quot; disables <em>all</em> damage and lets you land on or take off from any surface.</p> https://www.lexaloffle.com/bbs/?tid=148524 https://www.lexaloffle.com/bbs/?tid=148524 Sun, 20 Apr 2025 01:22:32 UTC Combat Chopper X <p> <table><tr><td> <a href="/bbs/?pid=165036#p"> <img src="/bbs/thumbs/pico8_mot_chopperx-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=165036#p"> mot_chopperx</a><br><br> by <a href="/bbs/?uid=39676"> Mot</a> <br><br><br> <a href="/bbs/?pid=165036#p"> [Click to Play]</a> </td></tr></table> </p> <p>This is an update of Combat Chopper to improve the resolution of the ground, at least close to the camera, using an <a href="https://www.lexaloffle.com/bbs/?tid=148149">enhanced version</a> of the <a href="https://www.lexaloffle.com/bbs/?tid=53583">Whiplash Taxi Co</a> ground drawing code.</p> <p>See the <a href="https://www.lexaloffle.com/bbs/?tid=50863">original game</a> for instructions on how to play.</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/choppergame_3.gif" alt="" /> <p>I had to sacrifice a few things in order to squeeze the ground drawing code in, particularly the heads-up artificial horizon, and the targeting camera effects, and the menu is now in a separate cart. Also it drops down to 15 fps a bit more than I'd like, but it feels pretty playable regardless.</p> <p>For comparison, here's shots with and without the new ground rendering:<br /> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/choppergame_36.png" alt="" /><img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/choppergame_35.png" alt="" /><br /> .</p> <p><img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/choppergame_34.png" alt="" /><img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/choppergame_33.png" alt="" /></p> https://www.lexaloffle.com/bbs/?tid=148243 https://www.lexaloffle.com/bbs/?tid=148243 Sat, 05 Apr 2025 09:41:51 UTC Extended tline <p> <table><tr><td> <a href="/bbs/?pid=164741#p"> <img src="/bbs/thumbs/pico8_mot_tlinex-2.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=164741#p"> Extended tline demo</a><br><br> by <a href="/bbs/?uid=39676"> Mot</a> <br><br><br> <a href="/bbs/?pid=164741#p"> [Click to Play]</a> </td></tr></table> </p> <p><em>Update: Bug fixes</em></p> <p>Here's a little line drawing routine I've used for Whiplash Taxi and some other work-in-progress carts.<br /> I wanted to package it up like a drop in <code>tline</code> replacement.</p> <p>It's equivalent to regular <code>tline</code>, but instead of drawing each tile it uses it to lookup a higher resolution 8x8 tile region and draws that instead. The result is a map with 8 times the detail (or 8 times the size, depending on how you look at it).</p> <p>The demo is a simple go-cart example. You can press X to toggle between the new routine and the regular <code>tline</code> function.</p> <p>The actual routine is in tab 1 and consumes 547 tokens.</p> <p>To use it, you first create some 8x8 &quot;textures&quot; at the top left of your map region:</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/tlinex p8_0.png" alt="" /> <p>Then you create corresponding sprites in sprite page 1:</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/tlinex p8_1.png" alt="" /> <p>Then use the sprites in page 1 to draw on the map:</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/tlinex p8_2.png" alt="" /> <p>Then call the <code>tlinex</code> function to render the map, the same way you would call the regular <code>tline</code>.</p> <p>Some caveats:</p> <ul> <li>It's slower than tline, because it's calculating and performing multiple tline calls.</li> <li>Especially if you zoom out a lot, it will slot down a lot (i.e. large values for the mdx,mdy parameters meaning the tline spans a lot of map cells)</li> <li>It doesn't handle <code>camera</code> offsets.</li> <li>It doesn't handle <code>clip</code> regions (and resets the <code>clip</code> region).</li> <li>There are some occasional visual artifacts.</li> </ul> <p>Perhaps someone will find this useful :)</p> https://www.lexaloffle.com/bbs/?tid=148149 https://www.lexaloffle.com/bbs/?tid=148149 Mon, 31 Mar 2025 10:11:01 UTC Medieval world generator <p> <table><tr><td> <a href="/bbs/?pid=161819#p"> <img src="/bbs/thumbs/pico8_mot_adv-2.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=161819#p"> mot_adv</a><br><br> by <a href="/bbs/?uid=39676"> Mot</a> <br><br><br> <a href="/bbs/?pid=161819#p"> [Click to Play]</a> </td></tr></table> </p> <p>Here's a medieval procedural world generator I'm working on. It has a few different biomes, buildings and roads.<br /> I'm thinking of turning it into some sort of Trial of the Sorcerer sequel.</p> <h3>Instructions</h3> <p>Give it a minute to generate the world, then open the pause menu and choose &quot;explore world&quot; to explore it in ray cast 3D.</p> <p>There's no gameplay yet, just walk around and explore.</p> <p>In the generator you can also use the direction pad to scroll around, and zoom in/out with X and O.</p> https://www.lexaloffle.com/bbs/?tid=147074 https://www.lexaloffle.com/bbs/?tid=147074 Sat, 08 Feb 2025 09:14:56 UTC Variable Inspector <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/sshot_0.png" alt="" /> <p>A quick port of my <a href="https://www.lexaloffle.com/bbs/?tid=43955">pico-8 variable inspector</a>, I find useful for debugging.<br /> It has a few more colours for readability, and can display userdata.</p> <p>To use, hit Esc to break out of your program and 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>dbg(v)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>Where <code>v</code> is the value to inspect.</p> <p>You can drill into values by clicking the &quot;+&quot; (or collapse them again by clicking &quot;-&quot;).<br /> Mouse wheel to scroll up and down.<br /> Press Esc when done.</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>-- debug inspector -- lines to display and scroll offset local dbg_lines,dbg_s={},0,false -- add item to display function dadd(n,v,i,p) -- insertion sort in name order while p&gt;1 and dbg_lines[p-1].i==i and type(dbg_lines[p-1].n)==type(n) and dbg_lines[p-1].n&gt;n do p-=1 end add(dbg_lines,{n=n,v=v,x=(type(v)==&quot;table&quot; or type(v)==&quot;userdata&quot;) and &quot;+&quot; or &quot; &quot;,i=i},p) end -- expand/collapse item function dexp(l,p) if l.x==&quot;+&quot; then -- add item properties to expand if type(l.v)==&quot;userdata&quot; then if l.v:height() and l.v:height()&gt;1 then for i=0,l.v:height()-1 do p+=1 dadd(i,l.v:row(i),l.i..&quot; &quot;,p) end elseif l.v:width() then for i=0,l.v:width()-1 do p+=1 dadd(i,l.v[i],l.i..&quot; &quot;,p) end end else for n,v in pairs(l.v) do p+=1 dadd(n,v,l.i..&quot; &quot;,p) end end l.x=&quot;-&quot; elseif l.x==&quot;-&quot; then -- delete nested lines to collapse while p&lt;#dbg_lines and #dbg_lines[p+1].i&gt;#dbg_lines[p].i do deli(dbg_lines,p+1) end l.x=&quot;+&quot; end end -- handle input function dinp() -- get mouse state local x,y,b,_,w=mouse() -- handle mouse click local click=b==1 if click and not dbg_click then local i=(y-14)\9+1 local p=dbg_s+i local l=dbg_lines[p] if l and(x-220)\5==#l.i then dexp(l,p) end end -- mouse wheel scrolls dbg_s=max(min(dbg_s-w*4,#dbg_lines-27),0) dbg_click=click end function dtostr(v,nopreview) if type(v)==&quot;userdata&quot; then local w,h,t,d=v:attribs() local r=t if h==1 then r..=&quot;[&quot;..w..&quot;]&quot; if w&lt;=16 and not nopreview then if t==&quot;f64&quot; then r..=&quot; (&quot;..string.format(&quot;%.2f&quot;,v[0]) else r..=&quot; (&quot;..v[0] end for i=1,w-1 do if t==&quot;f64&quot; then r..=&quot;,&quot;..string.format(&quot;%.2f&quot;,v[i]) else r..=&quot;,&quot;..v[0] end end r..=&quot;)&quot; end else r..=&quot;[&quot;..w..&quot;x&quot;..h..&quot;]&quot; end return r elseif type(v)==&quot;table&quot; then if #v&gt;0 then local r=&quot;[&quot;..#v..&quot;]&quot; if #v&lt;=16 and not nopreview then r..=&quot; (&quot;..dtostr(v[1], true) for i=2,#v do r..=&quot;,&quot;..dtostr(v[i], true) end r..=&quot;)&quot; end return r else return &quot;{}&quot; end else return tostr(v) end end -- draw UI function dui() while true do rectfill(220,10,470,260,1) for i=1,27 do local l=dbg_lines[i+dbg_s] if l then local x,y=220,(i-1)*9+14 x+=#l.i*5 local lx=x print(l.x,x,y,10) x+=5 print(l.n,x,y,12) x=max(x+#tostr(l.n)*5,lx+25) print(sub(dtostr(l.v),1,(470-x)\5),x,y,7) end end dinp() flip() end end function dbg(v,n) dadd(n or &quot;value&quot;,v,&quot;&quot;,#dbg_lines+1) cursor() pal() clip() dui() 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=145058 https://www.lexaloffle.com/bbs/?tid=145058 Sat, 02 Nov 2024 07:37:27 UTC min/max functions are expensive <p>I've noticed the <code>min</code> and <code>max</code> functions have a surprisingly high CPU cost.</p> <p>For example</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>a=stat(1) for i=1,1000 do b=min(1,2) end print(stat(1)-a)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>Outputs:<strong>0.103</strong></p> <p>Which is almost twice the CPU cost for <code>sqrt()</code></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>a=stat(1) for i=1,1000 do b=sqrt(2) end print(stat(1)-a)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>Outputs:<strong>0.054</strong></p> <p>And even if I define my own &quot;min&quot; function in lua, it's still a lot faster.</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 mymin(a,b) return a&lt;b and a or b end a=stat(1) for i=1,1000 do b=mymin(1,2) end print(stat(1)-a)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>Outputs:<strong>0.057</strong></p> <p>Is this a mistake?</p> https://www.lexaloffle.com/bbs/?tid=144954 https://www.lexaloffle.com/bbs/?tid=144954 Sun, 27 Oct 2024 11:11:23 UTC CSV parser <p>Here's a basic CSV parser I use to save tokens in my games. It uses <code>split</code> for the heavy lifting.</p> <h3>Basic version</h3> <p>The most basic version is 66 tokens.</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 data(str) local lines=split(str,&quot;\n&quot;) local props,d=split(deli(lines,1)),{} for l in all(lines) do local o,v={},split(l) for i=1,#v do o[props[i]]=v[i] end if(o.name)d[o.name]=o add(d,o) end return d 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 can be used like this (4 tokens):</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>spritetypes=data [[name,sx,sy,sw,sh alien,0,0,2,2 boss,4,0,4,4 player,0,2,4,2 bomb1,3,0,1,1 bomb2,2,1,1,1 bullet,2,0,1,1]]</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 <code>data</code> function returns an array of objects, with properties that map to the CSV columns.</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/csv3_0.png" alt="" /> <p>If objects have a <code>name</code> property, then they will be added as a property to the main object with that name.</p> <p>Which means we can reference the &quot;player&quot; sprite type as:</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>print(spritetypes.player.sx)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <h3>References</h3> <p>This version allows you to reference objects defined in other CSV tables. It's 117 tokens.</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>glob={ [&quot;true&quot;]=true, [&quot;false&quot;]=false } function data(str,globname) function fixval(v) if v==&quot;&quot; then return nil elseif glob[v]~=nil then return glob[v] end return v end local lines=split(str,&quot;\n&quot;) local props,d=split(deli(lines,1)),{} for l in all(lines) do local o,v={},split(l) for i=1,#v do o[props[i]]=fixval(v[i]) end if o.name then d[o.name]=o if(globname)glob[globname..&quot;.&quot;..o.name]=o end add(d,o) end return d 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 can be used like this:</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>spritetypes=data( [[name,sx,sy,sw,sh alien,0,0,2,2 boss,4,0,4,4 player,0,2,4,2 bomb1,3,0,1,1 bomb2,2,1,1,1 bullet,2,0,1,1]],&quot;spritetype&quot;) enemytypes=data( [[name,spritetype,health boss,spritetype.boss,100 alien,spritetype.alien,10]],&quot;enemytype&quot;) enemies=data [[typ,x,y,weapons enemytype.boss,112,40 enemytype.alien,20,50 enemytype.alien,80,50]]</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 routine maintains a <code>glob</code> variable containing objects that can be referenced, keyed by their name.</p> <p>The second parameter tells <code>data</code> to add objects to the <code>glob</code> table, so that they can be referenced from other CSV tables. For example passing &quot;spritetype&quot; to <code>data</code> means that the &quot;boss&quot; sprite type will be added as &quot;spritetype.boss&quot;.</p> <p>This version also maps &quot;true&quot; and &quot;false&quot; as their corresponding boolean values.</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/csv2_0.png" alt="" /> <h3>Arrays</h3> <p>And if you need array properties, this final version supports them. It's 170 tokens.</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>glob={ [&quot;true&quot;]=true, [&quot;false&quot;]=false } function maparray(a,fn) local r={} for e in all(a) do add(r,fn(e)) end return r end function data(str,globname) function fixval(v) if v==&quot;&quot; then return nil elseif type(v)==&quot;string&quot; and sub(v,1,1)==&quot;{&quot; then return maparray(split(sub(v,2,#v-1),&quot;:&quot;),fixval) elseif glob[v]~=nil then return glob[v] end return v end local lines=split(str,&quot;\n&quot;) local props,d=split(deli(lines,1)),{} for l in all(lines) do local o,v={},split(l) for i=1,#v do o[props[i]]=fixval(v[i]) end if o.name then d[o.name]=o if(globname)glob[globname..&quot;.&quot;..o.name]=o end add(d,o) end return d 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 used like so:</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>spritetypes=data( [[name,sx,sy,sw,sh alien,0,0,2,2 boss,4,0,4,4 player,0,2,4,2 bomb1,3,0,1,1 bomb2,2,1,1,1 bullet,2,0,1,1]],&quot;spritetype&quot;) enemytypes=data( [[name,spritetype,weapons,health boss,spritetype.boss,{spritetype.bomb1:spritetype.bomb2},100 alien,spritetype.alien,{spritetype.bullet},10]],&quot;enemytype&quot;) enemies=data [[typ,x,y,weapons enemytype.boss,112,40 enemytype.alien,20,50 enemytype.alien,80,50]]</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>Array values are enclosed in braces <code>{</code> <code>}</code>, and separated by semicolons <code>:</code>.<br /> (Commas would have been nicer, but that would require handling nesting, which couldn't use <code>split</code> and would need way more code.)</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/csv1_0.png" alt="" /> <p>I've used this routine pretty heavily in games like Trial of the Sorcerer and Combat Chopper, and it quickly pays for itself token wise. (Bonus if you can reuse the <code>maparray</code> function in other code.)</p> <p>For large CSV tables in complex projects I even store them in a separate CSV file that can be edited with a CSV editor, and paste it back into the Pico-8 source after making any changes.</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/Screenshot 2024-10-02 220223.png" alt="" /> https://www.lexaloffle.com/bbs/?tid=144545 https://www.lexaloffle.com/bbs/?tid=144545 Wed, 02 Oct 2024 08:42:34 UTC Titan <p> <table><tr><td> <a href="/bbs/?pid=152096#p"> <img src="/bbs/thumbs/pico8_mot_titan-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=152096#p"> Titan</a><br><br> by <a href="/bbs/?uid=39676"> Mot</a> <br><br><br> <a href="/bbs/?pid=152096#p"> [Click to Play]</a> </td></tr></table> </p> <p>I thought I'd upload this because I doubt I'll be able to finish it - at least as a Pico-8 game. Basically it was too ambitious and I ran out of space. Maybe I'll port it to Picotron someday, but for now it's basically a tech demo.</p> <p>You wake up in an android body in a factory in a mining town on Saturn's largest moon, Titan. You have to solve the mystery of who you are and what happened, and maybe how you can put things right.</p> <p>Or at least you would if the game was finished. For now there's a little puzzle about exiting the factory, and some dialog sequences. After that there's a car to drive, a slightly glitchy plane to fly and some empty buildings you can look inside.</p> <p>It's intended to be a game about exploration and dialog.</p> <p>Controls:</p> <ul> <li>Arrows/mouse to aim</li> <li>Controller 2 to move</li> <li>When the crosshair turns yellow you can press X to interact.</li> </ul> <p>Or you can switch it to single controller mode in the pause menu. (You can't strafe or look up/down, but that's not essential for this type of game.)</p> https://www.lexaloffle.com/bbs/?tid=143453 https://www.lexaloffle.com/bbs/?tid=143453 Sat, 03 Aug 2024 12:16:15 UTC ChatGPT 4o <p>ChatGPT 4o seems pretty good at writing Pico-8 code. (At least for simple games).</p> <p>I asked it:<br /> &quot;Can we try something different? Like a simple Space Invaders or Galaxians style game?<br /> I have 4 sprites in slots 1,2,3,4 with a player ship, alien invader, player bullet and enemy bullet respectively. Could you make a simple game where the aliens move left and right in formation, and the player moves left to right along the bottom of the screen?&quot;</p> <p>I got this.</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/ai1_0.gif" alt="" /> <p>I pasted the gif into the chat window, and it said:</p> <p>&quot;Awesome! It looks like the basic mechanics are working. Let's add a few more features to make the game more interesting:</p> <p>Enemy Bullets: Add bullets fired by the aliens.<br /> Player Lives: Track the player's lives and end the game when they run out.<br /> Score: Add a scoring system for each alien destroyed.&quot;</p> <p>Then gave me an updated version that looks like this:</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/ai1_1.gif" alt="" /> <p>Then I got worried that AI is doing all the work and I'm going to turn into the spaceship inhabitants in WAL-E. So I asked it to quiz me on the code and check my answers.</p> <p>It came up with questions like:</p> <p>&quot;Bullet Mechanics:</p> <p>Q3: How does the player fire bullets? What happens when a bullet is fired?<br /> Q4: How are player bullets updated and removed when they move off-screen?<br /> Alien Movement:</p> <p>Q5: How do the aliens move left and right in formation? What happens when they reach the edge of the screen?<br /> Q6: How do the aliens move downwards after reaching the screen edge?&quot;</p> https://www.lexaloffle.com/bbs/?tid=142351 https://www.lexaloffle.com/bbs/?tid=142351 Sun, 19 May 2024 23:16:24 UTC Profiler <p>Here's a little profiler you can drop into an existing program - if you have 313 tokens to spare.<br /> It instruments the global functions to count the number of calls and measure the CPU time spent inside them. Then it dumps it to a CSV file you can open in a spreadsheet viewer, and hopefully get some insight into where your program is spending the most time.</p> <p>Instructions are in the comments at the top.</p> <p>EDIT: </p> <ul> <li>Count fn calls in a single 32bit integer (thanks <a href="https://www.lexaloffle.com/bbs/?uid=25532"> @freds72</a>). </li> <li>Use &quot;...&quot; arguments syntax to support more than 9 arguments (thanks <a href="https://www.lexaloffle.com/bbs/?uid=9770"> @Siapran</a>)</li> <li>Save uninstrumented fns to avoid calling the instrumented ones when dumping stats.</li> </ul> <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>--&gt;8 -- profiler -- usage: -- run your program -- press esc to break -- &gt; _prof.begin() -- &gt; resume -- run your program some more (to gather data) -- press esc to break -- &gt; _prof.dump() -- this will dump a profile.csv file to the cart's folder -- notes: -- profiling for more than 2-3 minutes could cause cpu measurements -- to overflow, and give incorrect results. -- measures the amount of cpu spent in each function, where 1 is one whole frame -- so divide by frame rate to get seconds (30, or 60 if using _update60). -- profiling will slow down your program somewhat. _prof={ stats={}, -- list of global functions to *not* instrument donttouch={flip=true,__flip=true,_startframe=true,_update_buttons=true,_get_menu_item_selected=true,_update_framerate=true,_map_display=true,_mark_cpu=true}, -- original uninstrumented functions type=type, stat=stat, printh=printh, all=all, tostr=tostr, pairs=pairs } -- start profiling. -- if called multiple times, will reset stats _prof.begin=function() -- clear stats _prof.stats={} -- instrument functions if not _prof.instr then for n,v in _prof.pairs(_ENV) do if _prof.type(v)==&quot;function&quot; and not _prof.donttouch[n] then -- wrap function _ENV[n]=function(...) -- run and get cpu timing local cpuin=_prof.stat(1) return (function(...) -- update stats local cpuout=_prof.stat(1) local st=_prof.stats[n] or {ct=0,cpu=0} st.ct+=0x0.0001 st.cpu+=cpuout-cpuin _prof.stats[n]=st return ... end)(v(...)) end end end _prof.instr=true end end -- dump profile stats to file -- order is field to order by (name,ct,cpu,avg) -- defaults to &quot;cpu&quot; -- dst is printh destination -- defaults to &quot;profile.csv&quot; _prof.dump=function(order,dst) order = order or &quot;cpu&quot; dst = dst or &quot;profile.csv&quot; local rpt={} for n,v in _prof.pairs(_prof.stats) do local cpu,ct,sh=v.cpu,v.ct,16 -- average is cpu/(ct&lt;&lt;16), except that ct&lt;&lt;16 could -- overflow, in which case shift ct left as many bits -- as possible and shift cpu right the remaining bits. while sh&gt;0 and ct&lt;0x4000 do -- can't exceed 0x7fff as it would be treated as negative ct&lt;&lt;=1 sh-=1 end cpu&gt;&gt;=sh -- create stat local st={name=n,ct=v.ct,cpu=v.cpu,avg=cpu/ct} -- insert into rpt in order local i=#rpt+1 while i&gt;1 and (rpt[i-1][order]&gt;st[order])==(order==&quot;name&quot;) do rpt[i]=rpt[i-1] i-=1 end rpt[i]=st end -- print rpt _prof.printh(&quot;name,ct,cpu,avg&quot;,dst,true) for st in _prof.all(rpt) do _prof.printh(st.name..&quot;,&quot;.._prof.tostr(st.ct,2)..&quot;,&quot;..st.cpu..&quot;,&quot;..st.avg,dst) 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>Here's an example of my <a href="https://www.lexaloffle.com/bbs/?tid=49055">2D transforms demo</a>.<br /> For example you can see it spends a large amount of time in the &quot;map&quot; function (which would normally be suspicious except that the &quot;2D transforms&quot; replaces the standard &quot;map&quot; function with a custom version).</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/profiler.png" alt="" /> https://www.lexaloffle.com/bbs/?tid=140556 https://www.lexaloffle.com/bbs/?tid=140556 Fri, 08 Mar 2024 11:03:25 UTC Render from RAM <p> <table><tr><td> <a href="/bbs/?pid=141243#p"> <img src="/bbs/thumbs/pico8_mot_rendertest-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=141243#p"> mot_rendertest</a><br><br> by <a href="/bbs/?uid=39676"> Mot</a> <br><br><br> <a href="/bbs/?pid=141243#p"> [Click to Play]</a> </td></tr></table> </p> <p>A little experiment with rendering directly from Pico-8 RAM using &quot;peek&quot;.<br /> Trying to use as few tokens as possible.</p> https://www.lexaloffle.com/bbs/?tid=140131 https://www.lexaloffle.com/bbs/?tid=140131 Wed, 07 Feb 2024 04:13:04 UTC Mot's Animation System 2 <p> <table><tr><td> <a href="/bbs/?pid=140172#p"> <img src="/bbs/thumbs/pico8_mot_animsys2-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=140172#p"> Mot's Animation System 2</a><br><br> by <a href="/bbs/?uid=39676"> Mot</a> <br><br><br> <a href="/bbs/?pid=140172#p"> [Click to Play]</a> </td></tr></table> </p> <p>This has been sitting on my drive for a year or so. I was meaning to write up some documentation for it, but I'm throwing it up as is for now. (Until I can remember how to use it.)</p> <p>Basically it's a sequel to <a href="https://www.lexaloffle.com/bbs/?tid=38739">Mot's Animation System</a> built on top of the <a href="https://www.lexaloffle.com/bbs/?tid=49055">2D transforms</a> library. The main improvement being that it supports rotation.</p> <p>The basic idea is you create &quot;sprite&quot; animations based on frames on your tilemap. You can then combine them into &quot;timeline&quot; animations where position, rotation etc can be set at different points by creating keyframes.<br /> There's also a &quot;storyboard&quot; animation type that simply plays other animations in order.</p> <p>You can import gfx and tilemaps from other carts, save/load your projects. You can also export your animations to embed in your own projects if you wish. It's about 1700 tokens, although 1000 of that is the 2D transforms system. (I can post an example of this if anyone is interested.)</p> <p>I'd write up some more, but I need to remember how it works myself :).</p> <p>Maybe someone wants to have a play with it anyway.</p> <p>EDIT:</p> <p>Here's an example cart playing an exported image.<br /> It uses tabs 2,3,4 of the editor, except I recovered about 200 tokens by stripping out some unused bits.<br /> <table><tr><td> <a href="/bbs/?pid=140172#p"> <img src="/bbs/thumbs/pico8_mot_animsys2_test-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=140172#p"> Animation System 2 test</a><br><br> by <a href="/bbs/?uid=39676"> Mot</a> <br><br><br> <a href="/bbs/?pid=140172#p"> [Click to Play]</a> </td></tr></table> </p> https://www.lexaloffle.com/bbs/?tid=139857 https://www.lexaloffle.com/bbs/?tid=139857 Tue, 16 Jan 2024 00:34:26 UTC Whiplash Taxi Co <p> <table><tr><td> <a href="/bbs/?pid=132559#p"> <img src="/bbs/thumbs/pico8_mot_taxi-7.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=132559#p"> Whiplash Taxi Co</a><br><br> by <a href="/bbs/?uid=39676"> Mot</a> <br><br><br> <a href="/bbs/?pid=132559#p"> [Click to Play]</a> </td></tr></table> </p> <p><strong>UPDATE: Fixed suspension to lean towards the outside of turns, not the inside.</strong></p> <p>Welcome to the <strong>Whiplash Taxi Company</strong>, where our motto is &quot;The slower you're there, the lower the fare!&quot;</p> <p>As a valued employee and taxi driver, your job is to pick up passengers and deliver them to their destination as fast as possible, by any means necessary.</p> <p>Passengers are easy to spot, just look for the big red arrows over their heads.</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/mot_taxi p8_2.png" alt="" /> <p>Simply stop next to them so they can jump in!<br /> Then follow the red destination indicator to the destination and stop when it says &quot;stop!&quot;.</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/mot_taxi p8_11.png" alt="" /> <p>Repeat this as many times as possible in 5 minutes, and see how much $$$ you can bring in.</p> <p>But beware, sometimes the direct route isn't the quickest.<br /> To make it easier we have provide this giant map of Motsville. You may want to spend some time in &quot;Free Explore&quot; to get the layout. Or try some of the fully legitimate and not just driving-around-random-streets-way-too-fast street circuits, and maybe set a few lap records.</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/165_map.png" alt="" /> <p>Remember, at Whiplash Taxis when we say &quot;Break neck speeds&quot;, we mean it!<br /> (Hopefully not literally. Hopefully.)</p> https://www.lexaloffle.com/bbs/?tid=53583 https://www.lexaloffle.com/bbs/?tid=53583 Sun, 30 Jul 2023 10:31:59 UTC Taxi Game (maybe) <p> <table><tr><td> <a href="/bbs/?pid=131761#p"> <img src="/bbs/thumbs/pico8_mot_taxi-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=131761#p"> Taxi game</a><br><br> by <a href="/bbs/?uid=39676"> Mot</a> <br><br><br> <a href="/bbs/?pid=131761#p"> [Click to Play]</a> </td></tr></table> </p> <p>This is basically a Wolfenstein-3D style ray-caster with floor tiles.<br /> There's no gameplay or even collision detection so far.</p> <p>The top right of the Pico-8 map region is used to layout the game, using the sprites in tab 3.</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/taxi_0.png" alt="" /> <p>The sprites correspond to 8x8 regions in the top left of the map area, which represent the &quot;texture&quot; to draw.</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/taxi_1.png" alt="" /> https://www.lexaloffle.com/bbs/?tid=53352 https://www.lexaloffle.com/bbs/?tid=53352 Sat, 08 Jul 2023 23:12:48 UTC SDF Ray Marcher v2 <p> <table><tr><td> <a href="/bbs/?pid=125495#p"> <img src="/bbs/thumbs/pico8_mot_raymarch2-3.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=125495#p"> SDF Ray Marcher</a><br><br> by <a href="/bbs/?uid=39676"> Mot</a> <br><br><br> <a href="/bbs/?pid=125495#p"> [Click to Play]</a> </td></tr></table> </p> <p>I updated my ray marcher to use RGB colours internally and random dither back to 16 colours.<br /> This should allow me to add things like partially transparent surfaces, or atmospheric fog at some point.</p> <p><img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/raymarch_53.png" alt="" /><img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/raymarch_61.png" alt="" /><img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/raymarch_55.png" alt="" /><img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/raymarch_57.png" alt="" /></p> https://www.lexaloffle.com/bbs/?tid=51535 https://www.lexaloffle.com/bbs/?tid=51535 Wed, 08 Feb 2023 00:34:57 UTC Combat Chopper <p> <table><tr><td> <a href="/bbs/?pid=123143#p"> <img src="/bbs/thumbs/pico8_mot_chopper-2.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=123143#p"> Combat Chopper</a><br><br> by <a href="/bbs/?uid=39676"> Mot</a> <br><br><br> <a href="/bbs/?pid=123143#p"> [Click to Play]</a> </td></tr></table> </p> <p><em>WARNING: This game attempts to emulate old 8-bit flight simulators from the 80s and 90s. The flight model leans towards realism rather than easy-to-pickup arcade gameplay (even if it's somewhat primitive compared to serious modern-day flight simulators). As such it's not an easy to pickup game - controlling the helicopter is challenging and takes practice. In combat, even more so.</em></p> <p>Welcome to <em>Combat Chopper</em>, an 80s helicopter combat flight simulator for Pico-8!<br /> Pilot your <strong>P8 64k Apachi</strong> armored attack helicopter on a series of missions destroying key targets in enemy territory.</p> <h2>Getting started</h2> <h3>Training mode</h3> <p>Use the &quot;Training&quot; mode to practice controlling the helicopter before trying to take on any missions. You will need to be comfortable with keeping low, stopping and hovering, and landing, before attempting to engage in combat.<br /> Training mode is exactly like career mode, except there are no objectives, and you cannot be shot down.</p> <h3>Flight controls</h3> <p>The helicopter and weapon systems can be fully controlled using a single controller.</p> <p>When no button is held:</p> <ul> <li>Up/down -&gt; Pitch</li> <li>Left/right -&gt; Roll</li> </ul> <p>When the circle button (Z) is held:</p> <ul> <li>Up/down -&gt; Collective</li> <li>Left/right -&gt; Tail rotor</li> </ul> <p><strong>To take off, hold circle (Z) and press the up arrow</strong> until the helicopter starts climbing.<br /> A little bit of collective will make the helicopter hover just above the ground (due to the &quot;ground cushion effect&quot;). Adding more collective will cause the helicopter to continue climbing.</p> <p>Once airborne, press the arrow keys (without holding circle) to tilt the helicopter, which will cause it to accelerate in that direction.</p> <p>The cockpit gauges help you control your flight:</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/113_movement.png" alt="" /> <h3>Player 2 controls (optional)</h3> <p>Although the game can be played with just one controller you can use a second controller for extra precision.<br /> The player 2 arrow keys control the collective (up/down) and tail rotor (left/right).</p> <h3>Stopping</h3> <p>Being able to stop and hover is a useful skill.<br /> Essentially this involves raising the nose and tilting backwards until your speed reduces to zero.<br /> However, keep in mind that the helicopter has momentum and it takes some distance to brake from 100mph down to zero.<br /> Also tilting backwards at speed will cause the helicopter to climb rapidly making you an easy target for SAM launchers. To avoid this, drop the collective down first before lifting the nose. Try to balance the collective and pitch angle to keep the vertical speed as close to zero as possible. When your speed is close to zero, quickly add collective to avoid dropping quickly.</p> <h3>Landing</h3> <p>Landing is tricky to master, but is an essential skill.</p> <p>Use the map view to locate your base.</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/map.png" alt="" /> <p>It will be at the coordinates you took off from! Alternatively look for the orange dot on the map.</p> <p>Come to a hover next to your base, then turn to face it using the tail rotor controls.</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/chopper_24.png" alt="" /> <p>Approach the the helipad slowly (~10mph) using the collective and vertical speed indicator to control the rate of descent.</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/chopper_18.gif" alt="" /> <p>As you reach the helipad, tilt the nose up slightly to come to a hover and lower the collective until you touch down onto the helipad.</p> <h2>Combat</h2> <p>As well as piloting your helicopter, you will also need to destroy enemy units.<br /> This involves locating the enemy, targeting them, and selecting and firing the appropriate weapon.</p> <h3>Weapons and targeting</h3> <p>Hold cross (X) to access the weapon systems.<br /> While held:</p> <ul> <li>Up/down -&gt; Cycles through available targets.</li> <li>Left/right -&gt; Select the weapon/countermeasure to fire.</li> </ul> <p>Tap X to fire the selected weapon at the targeted unit.</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/combat.png" alt="" /> <p>From left-to-right the weapons are:<br /> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/123_wepnone.png" alt="" /> - No weapon. (I.e. safety on)<br /> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/124_wepcannon.png" alt="" /> - Cannon. Effective against all unit types, but has limited range.<br /> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/125_wepmissile.png" alt="" /> - Laser guided missile. Seeks the targeted unit. Ineffective against camps and outposts.<br /> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/weprocket.png" alt="" /> - Rockets. Fly straight forward. Effective against camps <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/unit_camp.png" alt="" /> and outposts <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/unit_outpost.png" alt="" />, but not other targets.<br /> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/wepcounter.png" alt="" /> - Countermeasures. Used to counter surface to air missiles (SAMs).</p> <p>In order to be targeted, an enemy unit must be visible (i.e. in front of you) and in range.<br /> Range depends on your altitude - the higher up you are the greater your targeting range. Beware that this works both ways - enemies can also target you from further away when you are higher up.</p> <p>When a unit is targeted a square reticle is displayed around it, and the unit is displayed in the targeting camera view. Enemy units have a red reticle and an &quot;E&quot; displayed in the bottom left corner of the target camera view. Friendly units have a blue/gray reticle and an &quot;F&quot; displayed.</p> <h3>Enemy fire</h3> <p>The main threat will be surface-to-air missiles (SAMs). Most units will fire these at you when they spot you.<br /> Beware of SAM launchers <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/unit_sam.png" alt="" /> as they fire more quickly and their missiles do greater damage.</p> <p>The IR and SAM dashboard lights tell you when an enemy is aiming and firing at you.</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/incomingfire.png" alt="" /> <p>If the IR light is lit an enemy is targeting you and getting ready to fire.<br /> The SAM light means a missile has been fired and is actively seeking you, and you should take action to avoid being hit.<br /> This might mean:</p> <ul> <li>Dropping a countermeasure. This is the most effective way to avoid getting hit, but you only have a limited supply. Each countermeasure lasts for 10 seconds.</li> <li>Dropping behind a hill is occasionally effective, if you have enough time.</li> <li>Attempting to evade by turning tightly or rapidly dropping altitude. This is risky but can work.</li> </ul> <p>The other threat is anti-aircraft (AA) guns. <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/unit_aa.png" alt="" /><br /> These fire shells at you which, unlike SAMs, do not seek and have a shorter range. However there is no warning indicator for AA guns and they are particularly dangerous if they catch you at close range moving slowly, or if you try to take them head on.</p> <h3>Damage</h3> <p>Damage is displayed in the mission objective display as a red bar. If the bar is fully red then you have been shot down, and your helicopter will crash to the ground.<br /> Damage also affects your engine and the amount of lift your rotors can generate.</p> <p>You can repair your helicopter by landing at a friendly helipad, and dropping the collective down to zero. This will also restock your weapons.</p> <h2>Missions</h2> <p>In career mode you will be given missions.<br /> Each involves destroying one or more enemy units at a specific location, then returning to and landing safely at your base.</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/mission.png" alt="" /> <p>The mission objective is displayed at the top of the dashboard.<br /> Use the map to find your way to the objective coordinates. The objective is displayed as a red dot.</p> <p>Once enough units have been destroyed at, or close to, the mission coordinates, the mission objective will change to &quot;Return to Base&quot;, and display the base coordinates.</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/returntobase.png" alt="" /> <h2>Tips</h2> <p>Some tips to help keep you in the air.</p> <h3>Keep low</h3> <p>Flying low is challenging. However keeping under 100 feet prevents you from being lit up like a Christmas tree to every SAM capable enemy unit.</p> <h3>Friendly space is to the west</h3> <p>If you need to retreat, head west.</p> <h3>Use the mountains</h3> <p>This is particularly important for missions deeper into enemy territory.<br /> The basic approach is:</p> <ol> <li>Fly to a mountain, keeping low, and come to a hover beside it. Ideally keeping it between you and enemy units.</li> <li>&quot;Pop up&quot; to 200-300 feet and look around for enemy units. Then drop down again before they can fire at you.</li> <li>Choose the next mountain.</li> <li>Decide which enemy units to destroy or avoid in order to reach the next mountain.</li> <li>Destroy the chosen units.</li> </ol> <p>Repeat the process until you are within range of your objective.</p> <h3>Watch out for AA guns</h3> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/39676/unit_aa.png" alt="" /> <p>Getting close to an anti-aircraft gun can quickly spoil your day.<br /> Destroy them from range or avoid.</p> https://www.lexaloffle.com/bbs/?tid=50863 https://www.lexaloffle.com/bbs/?tid=50863 Thu, 29 Dec 2022 00:01:03 UTC Helicopter flight sim <p> <table><tr><td> <a href="/bbs/?pid=120362#p"> <img src="/bbs/thumbs/pico8_mot_chopper-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=120362#p"> Chopper</a><br><br> by <a href="/bbs/?uid=39676"> Mot</a> <br><br><br> <a href="/bbs/?pid=120362#p"> [Click to Play]</a> </td></tr></table> </p> <p><strong>Update: Updated cart to latest version. This is probably close to what will be released.</strong></p> <p>A work-in-progress helicopter combat flight simulation. Loosely based on my memories of playing Gunship on C64 a few decades ago.</p> <p>The heli can be controlled with player 1 input:</p> <ul> <li>By default the arrow keys control the cyclic stick.</li> <li>Hold down circle (z) to switch to collective (up/down) and tail rotor (left/right).</li> <li>Hold down cross (x) for weapons mode, where up/down cycles between targets, and left/right selects the weapon.</li> <li>Tap cross (x) quickly to fire.</li> </ul> <p>So to take off, hold down circle (z) and up.</p> <p>Alternatively you can use player 2 input (E,S,D,F in keyboard) for collective and tail rotor.</p> <p>From left to right the weapons are:</p> <ul> <li>None (i.e. safety on)</li> <li>Cannon - auto aims. Effective against all unit types. Limited range.</li> <li>Lazer guided missile - Seeks current target. Effective against tanks.</li> <li>Unguided rockets - Fly straight ahead. Effective against infantry camps.</li> <li>Countermeasures - Drop one of these to divert incoming missiles.</li> </ul> https://www.lexaloffle.com/bbs/?tid=50124 https://www.lexaloffle.com/bbs/?tid=50124 Wed, 09 Nov 2022 05:22:16 UTC Walking Simulator <p> <table><tr><td> <a href="/bbs/?pid=117935#p"> <img src="/bbs/thumbs/pico8_mot_walksim-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=117935#p"> Walking Simulator</a><br><br> by <a href="/bbs/?uid=39676"> Mot</a> <br><br><br> <a href="/bbs/?pid=117935#p"> [Click to Play]</a> </td></tr></table> </p> <p>A little texture-mapped graphics engine with BSP-tree models and fog shading.<br /> Doesn't even try to maintain 30 FPS consistently :-)</p> <ul> <li>Player one controls aim. </li> <li>Player two controls strafe. </li> <li>X/O moves up and down.</li> </ul> <p>I still don't have a plan for this cart.</p> https://www.lexaloffle.com/bbs/?tid=49477 https://www.lexaloffle.com/bbs/?tid=49477 Sun, 25 Sep 2022 10:06:28 UTC