spellcaster [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=45707 Debug mode/ frame stepping <p>Here's a small code snippet that allows you to enter &quot;debug mode&quot; and then go frame by frame through your game.</p> <p>The idea is, that <code>_update()</code> wraps the <em>actual</em> <code>update()</code> function, and <code>_draw()</code> wraps the actual <code>draw()</code> function.<br /> So you can have extra output only drawn in debug mode, and go frame by frame through the game to do some bug hunting.<br /> It would also allow to append to a debug file only if debug mode is enabled.</p> <p>It's pretty simple code, but quite helpful.<br /> To switch to release mode, all you need to do is to swap the names of _draw() and draw() and _update() and update().</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 _init() poke(0x5f2d, 0x01) debug=false waitframe=false t=0 end function _update() if stat(30) then local ch=stat(31) if ch == &quot;d&quot; then if debug then waitframe = false debug = false else debug=true end end if debug and ch==&quot; &quot; then waitframe = false end end if not waitframe then update() if debug then waitframe = true end end end function update() t+=1 end function _draw() draw() -- debug information here if debug then print(debug,0,123,7) end end function draw() cls() print(t,2,2,7) 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=48282 https://www.lexaloffle.com/bbs/?tid=48282 Fri, 24 Jun 2022 10:34:01 UTC Wraith - iu Game Jam entry <p>This is a very small arcade game for a game jam.<br /> Theme was &quot;paranormal Activity&quot;<br /> In this game you're a wraith. Get close to those pesky humans to suck out their life force.<br /> Move to the magic circle to feed the portal the life force you gathered.<br /> Avoid those priests...</p> <p>Spent roughly a day, so don't expect too much :)</p> <p> <table><tr><td> <a href="/bbs/?pid=97531#p"> <img src="/bbs/thumbs/pico8_gubihuhoru-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=97531#p"> gubihuhoru</a><br><br> by <a href="/bbs/?uid=45707"> spellcaster</a> <br><br><br> <a href="/bbs/?pid=97531#p"> [Click to Play]</a> </td></tr></table> </p> https://www.lexaloffle.com/bbs/?tid=44675 https://www.lexaloffle.com/bbs/?tid=44675 Sun, 19 Sep 2021 06:47:47 UTC Isometric Heightmap demo <p> <table><tr><td> <a href="/bbs/?pid=80459#p"> <img src="/bbs/thumbs/pico8_isoheight-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=80459#p"> isoheight</a><br><br> by <a href="/bbs/?uid=45707"> spellcaster</a> <br><br><br> <a href="/bbs/?pid=80459#p"> [Click to Play]</a> </td></tr></table> </p> <p>Inspired by <a href="https://www.lexaloffle.com/bbs/?uid=38916"> @slainte</a> 's post, I wanted to code a simple isometric map renderer with height information.<br /> This is my first try - feedback on tiles and general how to approach this stuff is very welcome.</p> <p>Right now the height is bruteforced rendered by overlaying the tile sprites height times. This could be optimized by checking the surrounding height and not drawing the area that will be painted over anyway.</p> <p>Feedback very welcome :)</p> https://www.lexaloffle.com/bbs/?tid=39139 https://www.lexaloffle.com/bbs/?tid=39139 Fri, 07 Aug 2020 15:47:54 UTC Kitty <p> <table><tr><td> <a href="/bbs/?pid=79844#p"> <img src="/bbs/thumbs/pico8_kitty-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=79844#p"> kitty</a><br><br> by <a href="/bbs/?uid=45707"> spellcaster</a> <br><br><br> <a href="/bbs/?pid=79844#p"> [Click to Play]</a> </td></tr></table> </p> <p>I took the wander demo and changed it a bit by making it slightly more &quot;frogger&quot;-y. I thought it might be fun if somebody else would grab the cart and add something else to it, until we have a pico8-kitty frogger.</p> <p>:)</p> https://www.lexaloffle.com/bbs/?tid=38958 https://www.lexaloffle.com/bbs/?tid=38958 Fri, 24 Jul 2020 10:45:45 UTC Atomic Bonds <p> <table><tr><td> <a href="/bbs/?pid=79777#p"> <img src="/bbs/thumbs/pico8_picomol-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=79777#p"> picomol</a><br><br> by <a href="/bbs/?uid=45707"> spellcaster</a> <br><br><br> <a href="/bbs/?pid=79777#p"> [Click to Play]</a> </td></tr></table> </p> <p><strong> New version below, this is the first version </strong></p> <p>This is a remake of a game I coded <em>mumble</em> years ago with allegro.<br /> It's still very much WIP, I started today and just got the basics working and some rough sprites drawn.</p> <p>You can switch from joypad to mouse using a flag in the the code - which I would recommend if you can.<br /> I enabled the mouse emulation in this cart, since the manual mentioned problems with mouse support on the bbs.</p> <p>Issues:</p> <ul> <li>There is a bug when picking up an atom (it doesn't connect the free electrons to nearby other free electrons)</li> <li>in mouse emulation there is no bounds checking</li> </ul> <p>Todo:</p> <ul> <li>an actual goal for the game</li> <li>removing molecules when all electrons are bound</li> <li>levels</li> <li>game over mechanic</li> <li>and a lot more</li> <li>sound</li> <li>music</li> </ul> <p>Feedback welcome.</p> https://www.lexaloffle.com/bbs/?tid=38935 https://www.lexaloffle.com/bbs/?tid=38935 Wed, 22 Jul 2020 21:38:34 UTC Title Screens and more w/o sprites or tiles <p> <table><tr><td> <a href="/bbs/?pid=79504#p"> <img src="/bbs/thumbs/pico8_rle_demo-4.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=79504#p"> rle_demo</a><br><br> by <a href="/bbs/?uid=45707"> spellcaster</a> <br><br><br> <a href="/bbs/?pid=79504#p"> [Click to Play]</a> </td></tr></table> </p> <p>I needed a way to display graphics without using sprites/ or tiles.<br /> So I wrote a small python script that takes an 128x128 image, finds the best matching colors from either the normal or secret palette (or the best 16 colors of both) and stores that in a data string.</p> <p>If there's interest I can share the python code - main reason I haven't done so is, that I haven't made he python script user friendly :)</p> <p>No sprites used in this demo.</p> <p>You can download the image -&gt; string conversion tool and some example code here:<br /> <a href="https://github.com/iSpellcaster/pico8rle">https://github.com/iSpellcaster/pico8rle</a></p> https://www.lexaloffle.com/bbs/?tid=38887 https://www.lexaloffle.com/bbs/?tid=38887 Fri, 17 Jul 2020 17:52:01 UTC Background images w/o tiles <p>I wanted to create background images w/o having to use tiles/sprites for that.<br /> So I'm wroting a small python script, that takes a 128x128 png, reduces it to the most commonly 16 used colors from the pico8 palette, does RLE encoding on them and outputs the values as a string.</p> <p>This string can then be imported into pic8 and used to render your background image.</p> <img style="margin-bottom:16px" border=0 src="/media/45707/rle_0.gif" alt="" /> <p>The python part is not yet perfect (I need to write the custom palette generation code), but if you limit it to one of the two pals, it kinda works.</p> <p>End even when re-drawing the bg from the data every frame, it's kinda ok.</p> <p><strong>The encoder and the functions to use the result can now be found at: <a href="https://github.com/iSpellcaster/pico8rle">https://github.com/iSpellcaster/pico8rle</a></strong></p> <p><em>Here's the code of the latest version.</em><br /> Includes base64 encoded of variable sized sprites than can be flipped. Should run after copy and paste, nothing else required.<br /> To encode your own images, check the github link above.</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 _init() state = &quot;title&quot; title = explode64(kanji_rle) batman= explode64(bat_rle) antiriad = explode64(antiriad_title_rle) ryu=explode64(ryu_rle) t=0 _draw = draw_title start_t = time() end function _update() t+=1 if btnp(❎) then if state == &quot;title&quot; then _draw= draw_batman setpal(bat_pal) state=&quot;batman&quot; elseif state == &quot;batman&quot; then _draw= draw_antiriad state = &quot;antiriad&quot; start_t = time() pal2() else _draw= draw_title state = &quot;title&quot; start_t = time() pal() end end end function draw_title() local i,ofs,y ofs = flr((time()-start_t)*45) ofs2= flr((time()-start_t)*2) --rectfill(0,0,127,127,ofs2%4) cls() y = ofs%250-100 if y &gt; -127 then spr_rle(title,(128-title[1])/2,y) end spr_rle(ryu,15,20) spr_rle_flip(ryu,70,20) print(&quot;cpu:&quot;..stat(1),5,5,7) cprint(&quot;press ❎&quot;,nil,110,{9,10,9}) end function draw_batman() draw_rle(batman,0,0) print(&quot;cpu:&quot;..stat(1),5,5,7) cprint(&quot;press ❎&quot;,nil,110,{9,10,9}) end function draw_antiriad() draw_rle(antiriad,0,0) print(&quot;cpu:&quot;..stat(1),5,5,7) cprint(&quot;press ❎&quot;,nil,110,{9,7,9}) end -- util base64str='0123456789abcdefghijklmnopqrstuvwxyz!@#$%^&amp;*()_-+=[]}{;:&lt;&gt;,./?~|' bat_pal=&quot;94,90,95,9d,92,96&quot; bat_rle=&quot;20201,g61,461&gt;g1461&gt;471&gt;471&gt;471&lt;481&lt;481&lt;481:491:491:491;g1491;4a1;4a1;4a0%411c4b0%420441164b0%47164b0%43g143154c0$44k243144c0$45g142g1144c0$49g112g14c0#4b124d0#4b124d0p47064b10g14e0o4a034b0|g14g0n4p0?4j0n4o0.g14l0m4o0.4n0m4p0&gt;g14n0l4q0&gt;g14n0l4r0&lt;4o0l4s0;g14o0k4v0}g14o0k4x0[g14o0j4z0=4p0j4!0-g14p0j4@0_g14p0i4#0_gq0i4a014r0_g24o0i49034r0(g44n0h4a044v0$gr0f4b064%0tgr0f4a085bgk0f49075hgg0e49075mgc0e49075pg90e48085tg50d48095wg20d470a5y0e46095z0e450a5z0e440a5xg30e45095xg181g10d47075!g10d47075@0d47065s88g1810e46055t81g186g1810f44065tg186g2810o5v86g1820o5v86g1820n5x880n5y83g1830m5z83g1830m5qg182g146860l4b035c8744g1850k4b045b8a43g1840k4a055ag18b43840j49074/844ag18d41g1830i49084-034a85g1488j0i48094-054886g147g18i0h480a4-064781g185g1478i0f490c49024z08458946g18h0d490e49034z08448ag1458h0c490f49044p024807g1438c4589c185c10b490g49054n05460782428e4389c185c10a490h48074m07450584418f4387c285c109490i48084m08430584g18gg14187c185c209490i48094l0a42048uc185c2084a0i48094m0b41028hc185c285c284c308490j470b4d05430e8ac185c285c285c284c3074a0j460d4b08420d8ac185c284c384c384k1c207490k460e4a09420c84c184c285c284c483c1k1c183c1k1c18106490l460f490m84c284c284c285c7k2c5k1c18106480l470g4401430m84c283c285c284c8k1c5k2c18105480l470i4204420l83c284c284c8k1c6k1c5k2c18105480l470i4205410kc282c284c482c8k1c5k2c5k2c205470m470j420pc683cek2c5k2c4k2c304470m480k410pcgk1c6k1c6k2c4k2c304460n480l420mchk1c5k2c5k2c5k2c303460o480m420lcak1c5k2c5k2c5k2c4k3c303450p470o420kc4k1c5k1c5k2c4k3c4k3c4k3c34102440q470)c5k1c4k2c5k2c4k3c4k3c3k3c4470q470)c4k2c4k2c4k3c4k3c4k3c3k3c4460r470)c4k2c4k2c4k3c3k3c4k4c3k3c4490p460)c4k2c3k3c3k3c4k3c4k3c3k3c1814181c14c0m460(c4k3c3k3c3k3c4k3c3k4c5g144g14f0j460(c4k3c2k3c4k3c3k4c3k3c182g1484h0h460(c3k3c3k3c4k3c3k3c582g14b4k0e460*c4k3c3k3c3k3c4k3c181g14g4n0c440(c4k3c3k3c3k3c4k1c1814j4q09440(c3k4c2k5c1k4c182g14m4s07440*c4k4c2k4c2k281g14q4v04440*c4k4c1k4c182g14t4y01440*c3k4c3k1c1814x4$0&amp;c4k3c181g14@4$0&amp;c6814%4^0%83g14*4(0zg14+4-0tg14gg14gg44e4[0ng14ig348gc43g2484{0gg445g147gy484:0a81g;484,0481g&gt;48g14?gu8kg186g14883g14?gl8xg14885g14?g28[4988g14?g18+498bg14/g18_498e4?g18&amp;g1498gg14?g18$4a8j4?g184c186c18p4a8j5082c186c18p4a8j4383g14.g186c186c185c18bg14a8ig14386g14/82c285c285c18b4b8i44894/81c185c285c18b4b8i43g18bg14.g184c284c284c2854b&quot; kanji_rle=&quot;0^1s0eo1s2o2k20k0fk1s5o1410i0g41k1s5k10h0h41s5o10h0ho1s5o10h0gk1o1k2410747060g4105k2o4s7o2k1030i41k1o1sik1010fk1o2s8o6s8410ck1o1s6o2k209k1s6k109k1o2s5o1k141k1o34108k1s64105o1k102k1o1s1o2k203k1s4o107k1o1s5k10104o1s1410bk1s6410441o1s5o1410203k1s1o10co1k141s44103k1s5o1k10403s2k10e41s3o103o1s3o1k1410602k1s24107k205k1s3k10341k1410a02o1s1o108k1s14104o1s2o10h01k1s2o108k1s1k104o1s2o10h01o1s2k108s2o104o1s3k2410ek1s3k107k1s2o10441o1s5o10dk1s34107o1s2k106o1s4o10dk1s308s34107s4k10d0141o1k108k1o1k10641o1s3k10e0j41k1s3o1410f0ik1s3k1410h0hk1o2k10k0h4104k1o1s2k10e0j41k1o1s4o10e0h41o1s7o10e0ck4o1s9410e0c41o1s5o1s5o10f0ek1o1k241k1s4o1410f0jo1s4410g0i41s4k10h0io1s3k10i0h41s3o10j0hk1s2o10141k2o7k241060gk1s3o1seo241030ck3o1slo1030441o4stk10205o1sbo5k245k1o4s4k1020641k1o6k2410h44030^0^0^0^0^0^0^0o410g0mk1o1s1o1k10e0lo1s5k10d0j41o1s6o10d0ik1s7o10e0ho1s6o1k10f0f41o1s6k10h0ek1s5o2k20h0c41o1s4o1k101k1s2o10g0bk1o1s2o2k104o1s2o2k1410c0ao1s2o1k107o1s6k10b0jk1o1s8o10b0h41o1sb0b0fk1o1s9o2k20b0d41o1sao10f0ck1s3o2k24101o1s2o10f0bk1s1o1k14106k1s2o10f0mk1s2o10f0mk1s2o103k2o2k141060mk1s3o2s7o141040mo1se41030jk2o1s4o5s6k1030hk1o1s70541k1o1s2o1k1030ek1o1s4k2o1s2o10f0ck1o1s3o1k103k1s2o10f09k1o2s2o1k14105k1s2o10f07k1o1s3o1k108k1s2o10f0441o2s2o1k1410ak1s2o10f0241o1s2o2k10dk1s2o10fk1o1s2k20gk1s2o10fk30jk1s2o10f0mk1s2o10f0mk1s2o10f0mk1s2o10f0mk1s2o10f0mk1s2o10f0mo1s2o10f0fk2410341s3o10f0go1s2o2s4o10f0hk1s7k10f0ik1o1s5410f0ko1s3k10g0lk30h&quot; ryu_rle=&quot;0^1g0ig50i0hg284g20g0gg181g285g10f0go1g181g284g10f0go2g181g581g10e0g81o181o281o1g1k181g10e0fg181g2o182o1g1o1g20e0f81g1/1g1&lt;1g142/1g20f0bo1k101k1o1g1/1g1/1s141g20h09s1o1s2k1o2&lt;1g2/1&lt;1/2g20g05g5s1o1k1s1o1&lt;1/1g2/5g10g04g1&lt;1/3g1s1o1s1o1g1/2&lt;1g1&lt;1/1g40g03g1&lt;1/3s2o2s1g2/1&lt;1g3&lt;1/2g1o1k104o10a03g1/5o2s2&lt;1g1&lt;1g1/1g1&lt;1g3o6s1o10a03g1/4&lt;1o2s1o1/1&lt;1g2/1g1&lt;2g1o3s1o1s2o30903g1&lt;1/2&lt;1g1o2s1&lt;2/1g1/1g4o1s1o1s3g1&lt;2g10a02g1&lt;1g3&lt;2g1o1s1g1&lt;2w1g1&lt;1/1g2o1s1o1s1o1g1/3&lt;1g10902g1&lt;1/2&lt;1/3g1o1g2w2g6o1s3/5g10901g1/1g1&lt;1/1g1&lt;1/2g1o1g2w3g1&lt;1/2&lt;1o1s1o2g1&lt;1/3g10901g1/2&lt;2g3&lt;1g4w3g5s2o1&lt;1/3&lt;2g10901g1/2g1/3&lt;1g2w2g1w3g1&lt;1/2g1s2g1&lt;6g20801g1&lt;1g1/3&lt;2g2w2g2w1g6o1s1o1g1&lt;4g30801g3/6w4g341/2g2o1s3g80701g2&lt;3/3&lt;1w5g1&lt;141g3s1o1s2g2&lt;1g2&lt;1g1&lt;1g10702g2&lt;4g3w3g3s1o1s2o3s1g1&lt;5g1&lt;1g10702g1&lt;9g2o1s2o1s3o4g3&lt;2g40702g1&lt;7g3o4s4o5g4&lt;1/1&lt;1g20602g1&lt;1g1&lt;4g2o6s3o5g3&lt;4/2g10603g6ofg1/1g5&lt;2/1g10608ofg1/1g241g80508k1oeg2/2&lt;1g1w1g3&lt;1g20509k1oeg3/1g2w1g2&lt;2g1050943o943g1&lt;1/2g2w1g2&lt;2g1050941k14eg3/1g1w1g2&lt;1g10609k1o14ak1o241&lt;1/3g1w1g40608k1o347k1o5g3&lt;1w1g40708o441k1o142k1o4k1o2g1&lt;201g40807k1o342o2k141k1o5k1o2g20d07k2o242o342o5k1o20f07k1o2k142o342o5k1o20f07o442o342o6k20f06k1o442k1o242o6k1410f05k1o2s2o142o1k242k1o6k10f05o2s3o142k1o242o80f04k1o1s542k1o242o3s3o1k10f04o1s6o141k1o242o2s5o10f03k1o1s6o141k1o241o2s6o1k10e03o2s6o3k1o4s7o10e03o1s8o3k1o3s7o10e02k1o1s8o3k1o3s7o1k10d02k1o1s7o3k2o3s7k20d02o1s7o4k2o3s7o1k10d02o1s6o2s1o202k1o2s7o1k10d02o1s8o2k102k1o2s7o20d01k1o1s8o2k102k1o3s6o2k10c01k1o2s6o2k104o3s6o1s1o1k10b01k1o5s2o2k1o104k1o1s1o1s6o1s1o1k10a01k1ob05o2s1o1s1o1s3o1s1o1k10a01k1o8s1o1k105k1o1s3o5s1o20a01k1o7s2o1k106k1o1s3o7k10901k1o6s2o2k107k1o1s2o7k10902obk106k1oak10902obk107k1oa0902k1oak107k1oak10802k1oa09oak10802k1o9k109k1o9k1080241o9k10aoa080241oa0ak1oa0703oa0ak1o9k10703oa0bk1o9k10602oc0ak1o7g20702o8k1o1k10bk1o7g30603k1o5k101k10ck1o7&lt;1g20604g2o2g20ek1o1k1o1k1o2g1&lt;2g10604g1&lt;2g40ek101o101g2&lt;3g20503g1&lt;4g1&lt;1g10hg1&lt;6g20402g1&lt;6g30fg3&lt;5g204g2&lt;4g1&lt;2g30fg1/2g803g2&lt;1g3&lt;2g40fg1&lt;1/1g1/1g1/1g1&lt;1g203g1&lt;1g1/1g1&lt;1/1&lt;1g30ggb03&quot; antiriad_title_rle=&quot;20202020202020202020200jg1w5g105w#0.0jg1w6g104g1w!0/0kg1w6g104g1wy0?0lg1w6g10gw50lg20:0mg1w70fw50kw40;0ew6g102g1w706g1w403w503w4g102g1w404w607g1w40cg1w6g102g1w6g10b0dg1w703w805g1w403w502g1w4g102g1w403w806g1w40cw7g102g1w70b0cg1w803w8g104g1w403w502g1w4g102g1w402wa05g1w40bw8g102g1w80a0cw903w9g103g1w403w502g1w4g102g1w4g1wc04g1w40bw8g102g1w8g1090bwa03wag102g1w403w502g1w4g102g1w902w703g1w40aw9g102g1w9090ag1wa03wc01g1w403w502g1w4g102g1w804w702g1w409g1w9g102g1wa080awb03w5g1w7g1w403w502g1w4g102g1w706w701g1w408g1wag102g1wag10709g1wb03w4g101g1wb03w502g1w4g102g1w6g107w6g2w408wbg102g1wb0704g1w1g101g1w6g1w503w4g103wa03w502g1w4g102g1wk01g1w403g103w7g1w4g102g1w4g2w60604w3g1w701w503w4g103g1w903w502g1w4g102g1wj02g1w402g1w2g101w6g2w4g102g1w4g101w6g10503wb02w503w4g104g1w803w502g1w4g102g1w4g1wd03g1w401g1wag102w4g102g1w4g102w60502g1wag102w503w4g105g1w703w502g1w4g102g1w402g1wa04g1w4g1wb03w4g102g1w4g102g1w60402wb03w503w4g106g1w603w502g1w4g105w203g1w805g1w4g1wa04w4g102g1w4g103w6g10303g1w804w503w4g107g1w503w502g1w40181+58104w706g1w402w904w4g102g1w4g104w60304g1w6g104w503w4g108g1w403w502g1w2g101+904w705g1w403w7g104w4g102g1w4g104w70204w8g103w503w4g108g1w403w502g1w1g101+1810181+4s1}1+104w704g1w403w8g103w4g102g1w4g105w6g10103wag102w503w4g108g1w403w4g103g101+20381g1s3g1+204g1w603g1w402wag102w4g102g1w4g105g1w60102g1wbg101w503w4g108g1w403w30181+20281+302g1w2!1s1+3810181+2w702g1w401wcg2w4g102g1wh0102wj03w4g108g1w403g202+38101+581g1w1g1+58101+4g1w5g101g1w3g101wig102g1wg0201g1w601g1wb03w4g108g1w40281+382s282+6g2w1+601+1s281+3}1w3g101g1w1g101w7g1wbg102g1wf0301w603g1wa03w4g108g3}1+4s3+101+381+482g20181+581+381+1s3+3}18103g1w603wag102g1we0401w604g1w903w4g10781+4s6+201+3820e+382+3s4+5g1w5g104w9g102g1wd0502w406g1w803w4g105+4s4+48401+307g107+385+4s4+381w306w8g102g1wc0603w2g107g1w703w4g10581+1s2+485+301+3810481+30581+282+385+4s2+1}1w208w7g102g1wb070fg505g30781+284+882+28104}1s2+1}104+382+883+38101g10ag604ga0806gs0282+d0181+203+2s2+2810281+282+c8201w103gq0b06wug181+c83+28101+4s1+3810181+283+b82w2g101ws0a07wv0f+301+4s1+401+30ew401g1wr0b08wu028302820a+4s1+40983028301w301g1wr0c09ws02+58409+90984+504g1wq0d0#81+5810181+188+28105+387+18201+60(0#81+5810281+88102+2s1+1810181+98102+6810*0@+2s1+4810381+58103+68103+60481+70&amp;0z81+3s1+381018308+a81088202+4s1+30^0z81+802+286+4810481+487+1810181+80^0z81+80281+981028502+a0281+8810%0z85+3810381+6810281+7810281+68103+4850%0%81+2068304+b04830581+20_0!81+382+10a81+403g10281+4810a+10181+3810^0z81+5098201+4g881+3830a+50^0z+609+28101+20a81+201+309+5810%0y81+281+1820881+30181+1g109}1+18101+30982+40%0y81+4810981+281028102g203g202810281+20a+4810%0x81+681088101+304g1!103!105+3820881+60$0x+80581+68104g1s1!2s2g104+70581+80#0v81+48102+30481+68204g2!1g205+705+30281+4810!0t81+70181+30481+704g2!1s1g20481+705+382+70z0t81+a810581+6}1g202!1s1!3s1g101g1s2!2}1+406+481+60z0u81+6830681+4!1s2!1g102g1!2g1!202g1!2s3g1+30783+6810z0v+28202830681+3!1s2!1g104g1!303g2!1s4}1+207830281+30!0_81+2g1s4!1g104g1!1g105!1s4}1+1810}0)+481/1s3g309g3!1s1/1!181+3810[0(+501!1s2!1g1!208!1/1s1!4g101+50=0(+502g1!1g1s3!204g1!1s4!1g103+50=0(+504!1s5g103s6!2g3}1+40=0(+501g201g1s5/1!101!1s5!2s2!2g1+40=0(+5g1s2g101g1!1s3/1!101!1s3/1!1g2s4g1+40=0(+5s4g101g2!3g3!3g201g1!1s2!1g1+40=0(81+183s3!10hg1!4}1830=0+g1s2!1g106g407g1!1s2!10{0+!3g106g1!2g1s1g303g1s4g10{0-g1s1g1038103g1!5g302g1s3/1!20{0_81s2g2!1018202g1!301!302s3!401810}0_81s2g1!1g1018104g301g3s3!2g301+20}0)81g1s2!20181+18103g1!2g3s2!1g304+2810]0_!1s1!2g182+18103g301g2!2g10781+1810]0*81+181!1s2!10281+181s1}20h81+3810+0&amp;81+281s2!101+28103s2}2820c+6810-0)!1s2!101+382s1}1s1820e+4820+0&amp;8101!1s2!1g101+1810181}181s1}2g1}2810g820-0%+3g1!2g201+181g40181g1810181}1810b81+7810)0$+401g1!1g5!1s2!101g2s2g10c81+9810(0#81+18401g201g1!1s4/1g10181}1g382}10882+2870(0#+38402g1!1s5!1g2018102}1s1}10989+30*0r83}281}1w2}10181+7g1!1s4!2g402g30982+a8101w4}1w1}3830u0l82}3/1w1/9810186w1!1s2!4s2!10g82+487}1/1s1/3s1/3w3}4810p0g}4w1/c85/1}18103g1!3g2s3!2g1098307820581}1/2s1/5s1/9w1}2820l0b81}4w1/5}1w1/2}181}2w2/5s4/3w1g101g3s1!1g1048104s1/3s18104/3g1}1w2/4w1}186}1/f}1830h0883}2w1/8}2w2/4s1/1sc/105g104}1/204s4/104}1s1/3w5/bw3}3w7}481}1820f0883}2w2/6w1}2w1/6s7/1s5/18107}1/38104}1w1/30481w2/7sb/3}2/9w1}281}1820f0784}1w2/bw2}2w1/cw1}2810381}1/5w1088105w1/3sc/3s1/4}1/2s2/8w1}18201830c07}183}1w2/8s3/3}282w2/4w1}182g1s8/3w1810dg1!1w2/5s9/1s2/4}1/2s4/8w1}181}2820c08810182}1/1w1/b}2/5}5/3}2/1s4/1g1}1810g!1s2g103w2/3s7/6}1/2s6/7}2830e0983}4w2}1w1}1w2}1w1/3s5/3s1/1s2/2w181}2810kg1!1s2!1g10581}1/aw1}1w1/3s2/7w3}281}1810f0c}181}5w3/5s2/1s9/2}20p!1s3!107}1/6w1}1w1/3s4/9w1}3820g0e83}1w3/bs7/2}10qg1!1s3!10481w2}5/1w1}2w1/dw2}1820j0i81}3/1w1/3s1/4s1/1s1/80q!2g1!2g1w2/9s2/381}1/8w1}28101810l0k810182}3w2/1w1/d}10k81w1}101g1!3g1w1/1s5/3s3/2w1/3w1}6840o0q810184w5/1w1/7w182}1/3}1810a}1/2}1g1!1g2}1/1w1/ag1/1w1}6810w0y810182}7w4/5w10a}1/3w1}181}1w4}981}2810#0-81}70b}281}582}18101820-2020202020202020202020202020202020202020202020&quot; function test(x) print(&quot;hi &quot;..x) end base64str='0123456789abcdefghijklmnopqrstuvwxyz!@#$%^&amp;*()_-+=[]}{;:&lt;&gt;,./?~|' function explode_hex(s, delimiter) local retval,i=split(s,delimiter,false) for i=1,#retval do retval[i] =(&quot;0x&quot;..retval[i])+0 end return retval end function explode64(s) local retval,lastpos,i = {},1,2 while i &lt;= #s do add(retval,base64decode(sub(s, lastpos, i))) lastpos = i+1 i += 2 end return retval end function base64decode(str) val=0 for i=1,#str do c=sub(str,i,i) for a=1,#base64str do v=sub(base64str,a,a) if c==v then val *= 64 val += a-1 break end end end return val end function base64encode(val) local res,cur,i=&quot;&quot;, val while cur &gt; 0 do i=cur%64 res=sub(base64str,i+1,i+1)..res cur=flr(cur/64) end return res end function spr_rle(table,_x,_y) local x,y,i,col,rle,w=0,0,3,0,0,table[1] while i &lt;= #table do col = shr(table[i] &amp; 0xff00,8)--% 16 rle = table[i] &amp; 0xff i+=1 if col!=0 then --rectfill is slightly faster --line(x+_x,_y+y,_x+x+rle,_y+y,col) rectfill(x+_x,y+_y,x+_x+rle-1,_y+y,col) end x+=rle if x &gt;=w then x = 0 y += 1 end end end function spr_rle_flip(table,_x,_y) local x,y,i,col,rle,w=0,0,3,0,0,table[1] _x+=w while i &lt;= #table do col = shr(table[i] &amp; 0xff00,8)--% 16 rle = table[i] &amp; 0xff i+=1 if col!=0 then --rectfill is slightly faster --line(x+_x,_y+y,_x+x+rle,_y+y,col) rectfill(_x-x-rle+1,y+_y,_x-x,_y+y,col) end x+=rle if x &gt;=w then x = 0 y += 1 end end end function draw_rle(table,_x,_y) local x,y,i,col,rle,w=0,0,3,0,0,table[1] while i &lt;= #table do col = shr(table[i] &amp; 0xff00,8)--% 16 rle = table[i] &amp; 0xff i+=1 --rectfill is slightly faster --line(x+_x,_y+y,_x+x+rle,_y+y,col) rectfill(x+_x,y+_y,x+_x+rle-1,_y+y,col) x+=rle if x &gt;=w then x = 0 y +=1 end end end function setpal(palstr) local i,palindex palindex=explode_hex(palstr,&quot;,&quot;) for i=1,#palindex do pal(i-1,palindex[i],1) end end function pal2() local i for i=0,15 do pal(i,128+i,1) end end function cprint(txt,x,y,cols) local len,org=#txt*4+4,clip() local a x=x and x or 64-len/2 for a=1,3 do print(txt,x,y,cols[a]) clip(x,y+a*2,len,2) end clip(org) 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>Is there interest for something like this?<br /> Not sure if I should invest the time to make the python script &quot;presentable&quot; - right now it's quite a mess, and like I said not feature complete.</p> https://www.lexaloffle.com/bbs/?tid=38884 https://www.lexaloffle.com/bbs/?tid=38884 Fri, 17 Jul 2020 13:28:09 UTC Ghouls ate my Classmates <p> <table><tr><td> <a href="/bbs/?pid=78976#p"> <img src="/bbs/thumbs/pico8_ghoulsatemyclassmates-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=78976#p"> ghoulsatemyclassmates</a><br><br> by <a href="/bbs/?uid=45707"> spellcaster</a> <br><br><br> <a href="/bbs/?pid=78976#p"> [Click to Play]</a> </td></tr></table> </p> <p>Hello!<br /> just started with pico8, and played around with it.. this is (at the moment) just something to get used to the API. There's a function in there, that might be interesting for some of you, though. It prints a string with different colors per scanline.</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 _draw() cls() cprint(&quot;colored text&quot;,nil,20, {7,11,3}) cprint(&quot;pass nil for x to center&quot;,nil,30, {12,6,13}) cprint(&quot;press ❎ to start&quot;,nil,80,{9,10,9}) end function cprint(txt,x,y,cols) local len,org=#txt*4+4,clip() local a x=x and x or 64-len/2 for a=1,3 do print(txt,x,y,cols[a]) clip(x,y+a*2,len,2) end clip(org) 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=38701 https://www.lexaloffle.com/bbs/?tid=38701 Mon, 06 Jul 2020 09:10:52 UTC