progbod [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=84583 CRT effect on HTML published carts <p>Here's some code to add a old CRT monitor effect over your HTML-published carts.</p> <img style="margin-bottom:16px" border=0 src="/media/84583/Screenshot 2024-02-10 at 23.26.14.png" alt="" /> <p>I read an article recently about how low-res graphics looked better/softer on old CRT monitors and TVs, so did some googleing and found an effect you can apply via Cascading Style Sheets to your HTML-published game.</p> <p>When you've <code>export my_game.html</code> open up the .html file in a text editor and add the following inside a <code>STYLE</code> tag near the top of the file:</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> @keyframes flicker { 0% { opacity: 0.27861; } 5% { opacity: 0.34769; } 10% { opacity: 0.23604; } 15% { opacity: 0.90626; } 20% { opacity: 0.18128; } 25% { opacity: 0.83891; } 30% { opacity: 0.65583; } 35% { opacity: 0.67807; } 40% { opacity: 0.26559; } 45% { opacity: 0.84693; } 50% { opacity: 0.96019; } 55% { opacity: 0.08594; } 60% { opacity: 0.20313; } 65% { opacity: 0.71988; } 70% { opacity: 0.53455; } 75% { opacity: 0.37288; } 80% { opacity: 0.71428; } 85% { opacity: 0.70419; } 90% { opacity: 0.7003; } 95% { opacity: 0.36108; } 100% { opacity: 0.24387; } } @keyframes textShadow { 0% { text-shadow: 0.4389924193300864px 0 1px rgba(0,30,255,0.5), -0.4389924193300864px 0 1px rgba(255,0,80,0.3), 0 0 3px; } 5% { text-shadow: 2.7928974010788217px 0 1px rgba(0,30,255,0.5), -2.7928974010788217px 0 1px rgba(255,0,80,0.3), 0 0 3px; } 10% { text-shadow: 0.02956275843481219px 0 1px rgba(0,30,255,0.5), -0.02956275843481219px 0 1px rgba(255,0,80,0.3), 0 0 3px; } 15% { text-shadow: 0.40218538552878136px 0 1px rgba(0,30,255,0.5), -0.40218538552878136px 0 1px rgba(255,0,80,0.3), 0 0 3px; } 20% { text-shadow: 3.4794037899852017px 0 1px rgba(0,30,255,0.5), -3.4794037899852017px 0 1px rgba(255,0,80,0.3), 0 0 3px; } 25% { text-shadow: 1.6125630401149584px 0 1px rgba(0,30,255,0.5), -1.6125630401149584px 0 1px rgba(255,0,80,0.3), 0 0 3px; } 30% { text-shadow: 0.7015590085143956px 0 1px rgba(0,30,255,0.5), -0.7015590085143956px 0 1px rgba(255,0,80,0.3), 0 0 3px; } 35% { text-shadow: 3.896914047650351px 0 1px rgba(0,30,255,0.5), -3.896914047650351px 0 1px rgba(255,0,80,0.3), 0 0 3px; } 40% { text-shadow: 3.870905614848819px 0 1px rgba(0,30,255,0.5), -3.870905614848819px 0 1px rgba(255,0,80,0.3), 0 0 3px; } 45% { text-shadow: 2.231056963361899px 0 1px rgba(0,30,255,0.5), -2.231056963361899px 0 1px rgba(255,0,80,0.3), 0 0 3px; } 50% { text-shadow: 0.08084290417898504px 0 1px rgba(0,30,255,0.5), -0.08084290417898504px 0 1px rgba(255,0,80,0.3), 0 0 3px; } 55% { text-shadow: 2.3758461067427543px 0 1px rgba(0,30,255,0.5), -2.3758461067427543px 0 1px rgba(255,0,80,0.3), 0 0 3px; } 60% { text-shadow: 2.202193051050636px 0 1px rgba(0,30,255,0.5), -2.202193051050636px 0 1px rgba(255,0,80,0.3), 0 0 3px; } 65% { text-shadow: 2.8638780614874975px 0 1px rgba(0,30,255,0.5), -2.8638780614874975px 0 1px rgba(255,0,80,0.3), 0 0 3px; } 70% { text-shadow: 0.48874025155497314px 0 1px rgba(0,30,255,0.5), -0.48874025155497314px 0 1px rgba(255,0,80,0.3), 0 0 3px; } 75% { text-shadow: 1.8948491305757957px 0 1px rgba(0,30,255,0.5), -1.8948491305757957px 0 1px rgba(255,0,80,0.3), 0 0 3px; } 80% { text-shadow: 0.0833037308038857px 0 1px rgba(0,30,255,0.5), -0.0833037308038857px 0 1px rgba(255,0,80,0.3), 0 0 3px; } 85% { text-shadow: 0.09769827255241735px 0 1px rgba(0,30,255,0.5), -0.09769827255241735px 0 1px rgba(255,0,80,0.3), 0 0 3px; } 90% { text-shadow: 3.443339761481782px 0 1px rgba(0,30,255,0.5), -3.443339761481782px 0 1px rgba(255,0,80,0.3), 0 0 3px; } 95% { text-shadow: 2.1841838852799786px 0 1px rgba(0,30,255,0.5), -2.1841838852799786px 0 1px rgba(255,0,80,0.3), 0 0 3px; } 100% { text-shadow: 2.6208764473832513px 0 1px rgba(0,30,255,0.5), -2.6208764473832513px 0 1px rgba(255,0,80,0.3), 0 0 3px; } } .crt::after { content: &quot; &quot;; display: block; position: absolute; top: 0; left: 0; bottom: 0; right: 0; background: rgba(18, 16, 16, 0.06); opacity: 0; z-index: 2; pointer-events: none; animation: flicker 0.15s infinite; } .crt::before { content: &quot; &quot;; display: block; position: absolute; top: 0; left: 0; bottom: 0; right: 0; background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06)); z-index: 2; background-size: 100% 3px, 3px 100%; pointer-events: none; backdrop-filter: blur(0.4px); mix-blend-mode: color-burn; } .crt { animation: textShadow 1.6s infinite; } </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>Then find the line <code>id=&quot;p8_playarea&quot; style=&quot;display:none; margin:auto;</code> and change it to add a class of 'crt' like this: <code>id=&quot;p8_playarea&quot; class=&quot;crt&quot; style=&quot;display:none; margin:auto;</code></p> <p>You can see a working version here: <a href="https://steveattewell.com/alien/index_crt.html">https://steveattewell.com/alien/index_crt.html</a><br /> Go there and &quot;view source&quot; to see how it's done.</p> <p>I adapted this code to get the effect working: <a href="https://aleclownes.com/2017/02/01/crt-display.html">https://aleclownes.com/2017/02/01/crt-display.html</a> and did some tweaks and added some blur.</p> https://www.lexaloffle.com/bbs/?tid=140167 https://www.lexaloffle.com/bbs/?tid=140167 Sat, 10 Feb 2024 23:45:54 UTC Destroy the Puny Humans - WIP (v0.5) <h2>v0.5 Updated 3rd Dec 2023 - 2 players and some more levels</h2> <p>This is my first go at a Pico-8 game. Loving the Pico-8 and have learned a lot over the last couple of weeks.</p> <p><img style="margin-bottom:16px" border=0 src="/media/84583/alien_7.gif" alt="" /> <img style="margin-bottom:16px" border=0 src="/media/84583/alien_9.gif" alt="" /></p> <p>V0.2 - Updated to include weapon power ups that give you faster firing rates<br /> V0.4 - TANKS!!! cleaned up sounds. Extended music. Refactored map ready for multiple levels.<br /> <strong>v0.5 - 2 Player option, 5 levels (then stops rather abruptly!), boats, homing missiles, water level, adjusted difficulty</strong></p> <p>Shoot the puny humans...</p> <img style="margin-bottom:16px" border=0 src="/media/84583/alien_13.gif" alt="" /> <p>Pick up power ups for faster fire rate...</p> <img style="margin-bottom:16px" border=0 src="/media/84583/alien_0.gif" alt="" /> <p>Save the animals for points and health boost...</p> <img style="margin-bottom:16px" border=0 src="/media/84583/alien_1.gif" alt="" /> <h3>How to play</h3> <p>Objective: Destroy the puny humans<br /> Increase health by picking up the animals by flying low to the ground.<br /> Increase fire rate by picking up Crystals<br /> Increase speed by picking up stars<br /> Kill ground enemies by dropping bombs.<br /> Kill air enemies using your lasers!</p> <p>You <strong>will</strong> get shot at so make sure you save as many animals as you can to increase your health.</p> <p>How many points can you get? Would love to see score screenshots :)</p> <p>There may be bugs - please report if you find any. And let me know what the difficulty level is like.</p> <p> <table><tr><td> <a href="/bbs/?pid=136974#p"> <img src="/bbs/thumbs/pico8_destroy_the_puny_humans_v0_5-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=136974#p"> Destroy the puny humans v0.5</a><br><br> by <a href="/bbs/?uid=84583"> progbod</a> <br><br><br> <a href="/bbs/?pid=136974#p"> [Click to Play]</a> </td></tr></table> </p> <h2>Next steps</h2> <ul> <li>add more levels</li> <li>Bug: pickups, crashes and bullets still seem to hit player when dead in 2 player mode. </li> <li>only spawn power-ups when you haven&rsquo;t reached max-speed and max-firepower.</li> <li>Make there be a small chance of dropping a power if you get shot.</li> <li>&ldquo;SHIELDS&rdquo; power up that gives you infinite shield for 30 seconds (or maybe bind to a button).</li> </ul> <p>Thanks for your feedback.</p> https://www.lexaloffle.com/bbs/?tid=54912 https://www.lexaloffle.com/bbs/?tid=54912 Sun, 05 Nov 2023 18:18:46 UTC