btco [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=29526 Working on a desktop IDE <p>Working on a simple desktop-based PICO-8 IDE for Windows/Linux/MacOS. Features: syntax highlighting, code overview, reads/writes the P8 file format, copy/paste sprites directly to system clipboard for easy interop, large map editor.</p> <img style="margin-bottom:16px" border=0 src="https://www.lexaloffle.com/bbs/files/29526/pi610_ide_lo.gif" width=320 height=222 alt="" /> <p>What other features would you enjoy in a desktop IDE?</p> https://www.lexaloffle.com/bbs/?tid=31435 https://www.lexaloffle.com/bbs/?tid=31435 Fri, 22 Jun 2018 09:09:55 UTC Pilot8 Water Reflection Effect (demo, snippet) <p> <table><tr><td> <a href="/bbs/?pid=53251#p"> <img src="/bbs/thumbs/pico53250.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=53251#p"> Pilot8 Water Reflection Effect (demo, snippet)</a><br><br> by <a href="/bbs/?uid=29526"> btco</a> <br><br><br> <a href="/bbs/?pid=53251#p"> [Click to Play]</a> </td></tr></table> </p> <p>This is a short snippet showing how the water reflection effect is implemented in <a href="https://www.lexaloffle.com/bbs/?tid=31316">Pilot8</a>.</p> <p>Here is the 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> local g_rnd=nil local g_clk=0 function _init() init_rnd() end function init_rnd() g_rnd={} for i=1,64 do add(g_rnd,flr(rnd(32))) end end function _update() g_clk+=1 end function render_water(water_y) local addr_w=0x6000+64*water_y local addr_r=addr_w local rip_c=0x11 memset(addr_w,rip_c,64) for y=water_y+1,127 do addr_w+=64 addr_r-=(y%2)*64 local offset=1+(flr(g_clk/4)+y)%#g_rnd local prand=g_rnd[offset] if 0~=band(prand,30) then memcpy(addr_w,addr_r+prand%2*64,64) else memset(addr_w,rip_c,64) end end end function _draw() cls(0) map(0,0) print(&quot;pilot8 water effect&quot;, band(g_clk,127),88,7) render_water(96) 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><strong>Quick summary:</strong> I pre-generate some pseudo-random numbers on _init() because I want to use the same sequence every frame, shifted by the clock (to give continuity to the water animation, rather than make it random at every frame). Then, in render_water(), it's just a matter of starting at the water horizon line (water_y) and copying rows from above water to the area below the water line, one by one. Except that I move the &quot;read&quot; position only once every 2 frames to make the reflection &quot;stretched&quot;, and use the pseudo-random number to vary the read position to get the &quot;wavy&quot; effect. Also, once in while, instead of drawing the reflection I draw a solid blue ripple line.</p> <p>Feel free to reuse this code in any way you like!</p> https://www.lexaloffle.com/bbs/?tid=31369 https://www.lexaloffle.com/bbs/?tid=31369 Sun, 03 Jun 2018 22:04:14 UTC Pilot8 <p> <table><tr><td> <a href="/bbs/?pid=52927#p"> <img src="/bbs/thumbs/pico53240.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=52927#p"> Pilot8 1.1</a><br><br> by <a href="/bbs/?uid=29526"> btco</a> <br><br><br> <a href="/bbs/?pid=52927#p"> [Click to Play]</a> </td></tr></table> </p> <p>UPDATE: Version 1.1:</p> <ul> <li>faster ship</li> <li>constant enemy spawns (no delays)</li> <li>muzzle flash effect and better explosions</li> <li>other gameplay tweaks</li> </ul> <p>STORY: Welcome, Pilot 8. You are our top choice for this mission. I mean, 8th choice. Nothing suspicious at all happened to the other 7 pilots that came before you. They... uh... retired. Anyway, here is your comprehensive battle training: use the arrows to move, press [Z] to shoot. End of comprehensive training. Off to war you go. Good luck, Pilot 8.... Ok, that pilot is hopeless, let's start training Pilot 9. Oh, what? It's still on? How do I turn this off &lt;click&gt;</p> <p>This is a simple space shooter.</p> <ul> <li>18 levels across 6 worlds (Flood City, Oasis, Marshes, Coast, Canals, Fortress)</li> <li>Different weapons and powerups (shield, weapons, etc).</li> <li>Collect chips dropped by enemies to upgrade your ship. 14 upgrades available: <ul> <li>extra speed</li> <li>rapid fire (3 levels)</li> <li>ammo capacity (3 levels)</li> <li>shield (3 levels)</li> <li>starting laser</li> <li>powerup frequency</li> </ul></li> <li>World map</li> </ul> <p>Tech aspects:</p> <ul> <li>Dynamic lighting (via framebuffer post-processing).</li> <li>Screen-space reflection (water effect, lightning, etc).</li> <li>Particle effects, rain, etc.</li> </ul> https://www.lexaloffle.com/bbs/?tid=31316 https://www.lexaloffle.com/bbs/?tid=31316 Tue, 22 May 2018 13:07:42 UTC