gcoulby [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=75363 Isolation Breach <p> <table><tr><td> <a href="/bbs/?pid=128353#p"> <img src="/bbs/thumbs/pico8_tidiyonr-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=128353#p"> Isolation Breach</a><br><br> by <a href="/bbs/?uid=75363"> gcoulby</a> <br><br><br> <a href="/bbs/?pid=128353#p"> [Click to Play]</a> </td></tr></table> </p> <p>This is a PICO-8 game I made called Isolation Breach. It is based one of the hacking mini game from Alien Isolation.</p> <p><img src="https://github.com/gcoulby/isolation-breach-p8/raw/main/isolation-breach.p8.png" alt="https://github.com/gcoulby/isolation-breach-p8/raw/main/isolation-breach.p8.png" /></p> <h2>Instructions</h2> <hr /> <p>The goal of the game is to identify the patterns in the callback code and select them from the bottom in order from left to right.</p> <p>You can move the cursor around the screen using ⬅️➡️ and pressing 🅾️ to select a number.</p> <p>You will gain points based on the time it takes you to find the target number and the level of difficulty you have selected.</p> <p>This game stores your high score locally on your PICO-8 console.</p> https://www.lexaloffle.com/bbs/?tid=52368 https://www.lexaloffle.com/bbs/?tid=52368 Sun, 09 Apr 2023 15:27:49 UTC Number Hunter <p> <table><tr><td> <a href="/bbs/?pid=128217#p"> <img src="/bbs/thumbs/pico8_dodoyoyiwi-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=128217#p"> Number Hunter</a><br><br> by <a href="/bbs/?uid=75363"> gcoulby</a> <br><br><br> <a href="/bbs/?pid=128217#p"> [Click to Play]</a> </td></tr></table> </p> <p>This is a PICO-8 game I made called Number Hunter. It is based on hacking mini games I used to play on FiveM servers.</p> <h2>Instructions</h2> <hr /> <p>The goal of the game is find the fixed target number amongst the constant random generation of numbers on the screen.</p> <p>You can move the cursor around the screen using ⬅️➡️ and pressing 🅾️ to select a number.</p> <p>You will gain points based on the time it takes you to find the target number and the level of difficulty you have selected.</p> <p>This game stores your high score locally on your PICO-8 console.</p> <hr /> <h2>Source Code</h2> <p>While the code is available from within the embedded PICO-8 console above, the project is also available on GitHub <a href="https://github.com/gcoulby/number-hunter-p8">https://github.com/gcoulby/number-hunter-p8</a></p> https://www.lexaloffle.com/bbs/?tid=52335 https://www.lexaloffle.com/bbs/?tid=52335 Thu, 06 Apr 2023 10:46:19 UTC Reusable Actor Class (Quick Start Library) <p> <table><tr><td> <a href="/bbs/?pid=128080#p"> <img src="/bbs/thumbs/pico8_gersujanu-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=128080#p"> Reusable Actor Class</a><br><br> by <a href="/bbs/?uid=75363"> gcoulby</a> <br><br><br> <a href="/bbs/?pid=128080#p"> [Click to Play]</a> </td></tr></table> </p> <h1>What is this?</h1> <p>FULL CODE AT: <a href="https://github.com/gcoulby/pico-8-reusable-actor">https://github.com/gcoulby/pico-8-reusable-actor</a></p> <p>&gt; THIS IS ACTUALLY LICENSED AS CC4-BY-SA and I have no issues with this being used commercially if you wish to use this without attribution, please contact me.</p> <p>This project is completely free to use and modify. If you appreciate my work, and would like to say thank you, you can buy me a coffee:</p> <p><a href="https://ko-fi.com/X8X64ELNE"><img src="https://www.vectorlogo.zone/logos/ko-fi/ko-fi-ar21.svg" alt="ko-fi" /></a></p> <h1>Pico-8 Actor Class</h1> <p>This is a simple class for creating actors in Pico-8. It's a work in progress, I'm open to suggestions and improvements.</p> <p>Pico-8 is a fantasy console for making, sharing and playing tiny games and other computer programs. It is developed by Lexaloffle Games. You can find out more about Pico-8 here: <a href="https://www.lexaloffle.com/pico-8.php">https://www.lexaloffle.com/pico-8.php</a></p> <h2>Cart Info</h2> <p><img src="https://github.com/gcoulby/pico-8-reusable-actor/raw/main/reusable-actor.p8.png" alt="https://github.com/gcoulby/pico-8-reusable-actor/raw/main/reusable-actor.p8.png" /></p> <table> <thead> <tr> <th style="text-align: left;"></th> <th style="text-align: left;">Used</th> <th style="text-align: left;">Available</th> <th style="text-align: left;">Percentage</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">Tokens</td> <td style="text-align: left;">1244</td> <td style="text-align: left;">8192</td> <td style="text-align: left;">15%</td> </tr> <tr> <td style="text-align: left;">Chars</td> <td style="text-align: left;">4833</td> <td style="text-align: left;">65535</td> <td style="text-align: left;">7%</td> </tr> <tr> <td style="text-align: left;">Compressed</td> <td style="text-align: left;">1576</td> <td style="text-align: left;">15616</td> <td style="text-align: left;">10%</td> </tr> </tbody> </table> <p>(this is just for the actor class, not the demo)</p> <p>While this currently uses 15% of the available tokens, I intend to reduce this once I have finished the class. I also think that the size of class is acceptable given the functionality it provides. Admittedly, since this class supports multiple game types, it is a bit larger than it needs to be and could be pruned once it is applied to your game. If you have any suggestions on how to reduce the size of the class, please let me know. I'm open to suggestions.</p> <p>I welcome Pull Requests and Issues on GitHub:</p> <p>&gt; <a href="https://github.com/gcoulby/pico-8-reusable-actor">https://github.com/gcoulby/pico-8-reusable-actor</a></p> <h2>Features</h2> <p>☑️ Simple, easy to use</p> <p>☑️ Configurable</p> <p>☑️ Supports collision</p> <p>☑️ Supports collision with map offsets</p> <p>☑️ Supports sprite collections (multiple sprites per actor/animation)</p> <p>☑️ Supports movement</p> <p>☑️ Supports gravity</p> <p>☑️ Supports jumping</p> <p>☑️ Supports animations</p> <p>☑️ Supports multiple animations</p> <p>☑️ Supports multiple sprites</p> <p>☑️ Supports top-down movement</p> <p>☑️ Supports platformer movement</p> <p>☑️ Supports sliding down walls</p> <p>☑️ Supports collision with map tiles</p> <p>☑️ Supports collision with window</p> <p>&gt; Collisions with other actors are not built into this class as it will be different for each game and even each actor. The intention would be that you would do this in your game's code.</p> <hr /> <h2>Helper Functions</h2> <p>&gt; Before exploring the functions and properties of the actor class, it is important to understand the helper functions that are used by the actor class. These functions are used by the actor class to perform various tasks. They are not intended to be called directly. They are documented here for completeness.</p> <h3>Get Flag for Map Tile</h3> <p><code>fmget(x, y, f)</code></p> <p>This function is used to get the value of a flag from a map tile. It is used by the <code>chk_cols()</code> method. It should not be called directly. This function's primary purpose is to check to reduce the tokens used when checking collisions.</p> <h3>Create Sprite Collection</h3> <p><code>create_spr_col(sprites, flipX, flipY)</code></p> <p>This function is used to create a sprite collection for drawing actors that are bigger than 8px*8px. A sprite collection is a table of sprites that are drawn to the screen. It is used by the <code>draw()</code> method. It should not be called directly.</p> <p>The <code>sprites</code> parameter is a table of sprites. The sprites should be in the order that they should be drawn to the screen for example if your sprite sheet contains a 16px*16px sprite for the actor standing still using sprites <code>0</code>, <code>1</code>, <code>16</code>, and <code>17</code> then the <code>sprites</code> table should look 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>sprites = { {0, 1}, {16, 17} }</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>flipX</code> parameter is a boolean value that is used to flip the sprite horizontally. The <code>flipY</code> parameter is a boolean value that is used to flip the sprite vertically.</p> <p>The flipX and flipY parameters flip the both the individually drawn sprites and the sprite collection as a whole. For example, if you use the above <code>sprites</code> table as an example, and you set <code>flipX</code> to <code>true</code> then the sprite collection will look like this:</p> <table> <thead> <tr> <th style="text-align: left;">With <code>flipX</code> set to <code>false</code>:</th> <th style="text-align: left;"></th> <th></th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">0</td> <td style="text-align: left;">1</td> </tr> <tr> <td style="text-align: left;">16</td> <td style="text-align: left;">17</td> </tr> </tbody> </table> <table> <thead> <tr> <th style="text-align: left;">With <code>flipX</code> set to <code>true</code>:</th> <th style="text-align: left;"></th> <th></th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">1</td> <td style="text-align: left;">0</td> </tr> <tr> <td style="text-align: left;">17</td> <td style="text-align: left;">16</td> </tr> </tbody> </table> <p>This allows the sprite collection to be flipped horizontally without having to change the order of the sprites in the <code>sprites</code> table.</p> <h3>Create Animation</h3> <p><code>create_anim(spr_cols, delay)</code></p> <p>This function is used to create an animation for an actor. An animation is a table of sprite collections that are drawn to the screen. It is used by the <code>draw()</code> method. It should not be called directly.</p> <p>The <code>_spr_cols</code> parameter is a table of sprites and is passed into the function in the same format as the <code>create_spr_col()</code> function. However, the <code>_spr_cols</code> parameter is a table of sprite collections, where the each element in the table is a sprite collection. The example below shows the animation for the wall slide animation used in the platformer demo:</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> ```lua _spr_cols = { {{6,7},{22,23}}, {{8,9},{24,25}}, {{10,11},{26,27}}, {{12,13},{28,29}}, {{14,15},{30,31}} }</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>Each row is a sprite collection that represents a frame of the animation. The first sprite collection in the table is the first frame of the animation, the second sprite collection is the second frame of the animation, and so on. The <code>delay</code> parameter is the delay between frames of the animation. It is used to control the speed of the animation.</p> <p>&gt; This function should not be called directly. It is used by the <code>add_anim()</code> method.</p> <h3>MAP_X and MAP_Y</h3> <p>This actor class requires MAP_X and MAP_Y to be defined. These are the x and y offsets of the map.</p> <hr /> <h2>Usage</h2> <p>Now that we have explored the helper functions, let's explore the actor class.</p> <p>To use the class, simply copy the contents of <code>actor.lua</code> into your cartridge or add <code>#include actor.lua</code> to your cartridge. Then, create a new actor by calling <code>actor:new()</code> and passing in the configurable parameters.</p> <p>It is recommended to use comment blocks to show what each parameter does. This is what I use in this 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>p = actor:new( --[[x]]59, --[[y]]59, --[[w]]8, --[[h]]8, --[[flipX]]false, --[[flipY]]false, --[[dx]]0, --[[dy]]0, --[[max_dx]]2, --[[max_dy]]3, --[[max_jumps]]1, --[[acc]]0.5, --[[boost]]6, --[[grav]]0.2, --[[fric]]0.6, --[[cm]]true, --[[cw]]true, --[[slide]]false, --[[game_type]]type.side )</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>You should declare animations after creating the actor. This is done by calling <code>p.add_anim()</code> and passing in the animation name and the sprite indexes. See <a href="#add-animations">Add Animations</a> and <a href="#create-animation">Create Animation</a> for more details on how they work.</p> <p>The name is used to identify the animation. The sprite indexes are used to identify the sprites used for the animation. The last parameter is the speed of the animation. The higher the number, the slower the animation.</p> <p>There are five animations declared by default in the Actor class' constructor code: <code>idle</code>, <code>walk</code>, <code>jump</code>, <code>fall</code>, and <code>slide</code>. You can change these by calling <code>p.set_anim()</code> and passing in the animation name. See <a href="#set-animation">Set Animation</a> for more details on how it works. These are declared in the constructor code as follows to protect against errors:</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>o.anims={ [&quot;idle&quot;]=create_anim({{{0}}},1), [&quot;run&quot;]=create_anim({{{0}}},1), [&quot;jump&quot;]=create_anim({{{0}}},1), [&quot;fall&quot;]=create_anim({{{0}}},1), [&quot;slide&quot;]=create_anim({{{0}}},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>You should declare overrides to these follows:</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.add_anim(&quot;idle&quot;, { {{64,65},{80,81}}, {{66,67},{82,83}}, {{68,69},{84,85}}, {{70,71},{86,87}}, {{72,73},{88,89}}, {{74,75},{90,91}}, {{76,77},{92,93}}, {{78,79},{94,95}}, {{96,97},{112,113}}, {{98,99},{114,115}}, {{100,101},{116,117}}, }, 4)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>You can also add new animations by calling <code>p.add_anim()</code> and passing in the animation name and the sprite indexes.</p> <hr /> <h2>Parameters</h2> <h3>x, y, w, h</h3> <p>These are the starting x and y coordinates of the actor, as well as the width and height of the actor. The width and height are used for collision detection.</p> <h3>flip_x, flip_y</h3> <p>These are used for flipping the actor. Set them to <code>true</code> to flip the actor on the X or Y axis.</p> <h3>dx, dy</h3> <p>These are the x and y velocities of the actor. They are used for movement.</p> <h3>max_dx, max_dy</h3> <p>These are the maximum x and y velocities of the actor. They are used for movement.</p> <h3>max_jumps</h3> <p>This is the maximum number of jumps the actor can perform. It is used for platformer movement. Set it to 0 for no jumps. Set it to -1 for infinite jumps. Set it to 1 for single jumps. Set it to 2 for double jumps, etc.</p> <h3>acc</h3> <p>This is the x-axis acceleration of the actor. It is used for movement.</p> <h3>boost</h3> <p>This is the jump speed of the actor. It is used for movement.</p> <h3>grav</h3> <p>This is the amount of gravity acting upon the actor. It is used for gravity.</p> <h3>fric</h3> <p>This is amount of friction acting upon the actor. It is used for movement.</p> <h3>cm, cw</h3> <p>These are used for collision detection. <code>cm</code> is used for collision with map tiles, and <code>cw</code> is used for collision with window.</p> <h3>slide</h3> <p>This is used for collision detection. It is used for sliding down walls.</p> <h3>type</h3> <p>This is used for movement. It can be set to <code>type.side</code> for platform movement, <code>type.top</code> for top-down movement.</p> <h2>Methods</h2> <h3>Update</h3> <p><code>update()</code></p> <p>This method is used to update the actor. It should be called in the <code>_update()</code> function or the <code>_update60()</code> function.</p> <p>The <code>_update()</code> function is called 30 times per second, and the <code>_update60()</code> function is called 60 times per second. The current demo uses the <code>_update()</code> so that you can see the animations more clearly. However, you can use <code>_update60()</code> if you want. You just need to configure the movement parameters accordingly to make it feel right.</p> <h3>Draw</h3> <p><code>draw()</code></p> <p>This method is used to draw the actor. It should be called in the <code>_draw()</code> function.</p> <h3>Move X</h3> <p><code>moveX()</code></p> <p>This method is used to move the actor horizontally. It should be called in the <code>_update()</code> function or the <code>_update60()</code> function.</p> <h3>Move Y</h3> <p><code>moveY()</code></p> <p>This method is used to move the actor vertically. It should be called in the <code>_update()</code> function or the <code>_update60()</code> function.</p> <h3>Jump</h3> <p><code>jump()</code></p> <p>This method is used to make the actor jump. It should be called in the <code>_update()</code> function or the <code>_update60()</code> function.</p> <h3>Apply Forces</h3> <p><code>apply_forces()</code></p> <p>This method is used to apply gravity and friction to the actor. It also contains the code for sliding down walls. It should not be called directly.</p> <h3>Check Collisions</h3> <p><code>chk_cols()</code></p> <p>This method is used to check for collisions. It is used by the <code>moveX()</code> and <code>moveY()</code> methods. It should not be called directly. This method checks to see if the resulting movement will cause a collision. The <code>moveX()</code> and <code>moveY()</code> methods will then adjust the movement accordingly.</p> <h3>Check Ground</h3> <p><code>chk_gnd()</code></p> <p>This method is used to check if the actor is on the ground. It is used by the <code>moveY()</code> method. It should not be called directly. This method checks to see if the actor is on the ground.</p> <h3>Check Ceiling</h3> <p><code>chk_ceil()</code></p> <p>This method is used to check if the actor is on the ceiling. It is used by the <code>moveY()</code> method. It should not be called directly. This method checks to see if the actor is touching the ceiling.</p> <h3>Check Wall</h3> <p><code>chk_wall()</code></p> <p>This method is used to check if the actor is touching a wall. It is used by the <code>moveX()</code> method. It should not be called directly. This method checks to see if the actor is touching a wall. This method is also used by the <code>apply_forces()</code> method to check if the actor is sliding down a wall.</p> <h3>Get Coordinate</h3> <p><code>get_coord(lc, c)</code></p> <p>This method is used to get the coordinate of the actor in the event of a collision. It is used by the <code>moveX()</code> and <code>moveY()</code> method. It should not be called directly.</p> <p>lc is the last coordinate of the actor. It is the coordinate of the actor before the movement.</p> <p>c is the current coordinate of the actor. It is the coordinate of the actor after the movement.</p> <p>This method returns the coordinate of the actor in the event of a collision.</p> <h3>Add Animations</h3> <p><code>add_anim(name, spr_cols, d)</code></p> <p>This method is used to add an animation to the actor. It should be called in the <code>_init()</code> function.</p> <p>name is the name of the animation. It is used to identify the animation.</p> <p>d is the delay between frames of the animation. It is used to control the speed of the animation.</p> <p>spr_cols is a table of sprite collections. See the <a href="#create-animation">Create Animation</a> section for more information.</p> <hr /> <h2>Demo</h2> <p>There is a demo included in the repository. It is a simple platformer with an actor and a map. You can configure the parameters from within pico-8 to see how they work.</p> <h2>License</h2> <p>This project is licensed under the CC-BY-NCSA 4.0 license. See the LICENSE file for more information.</p> <hr /> <h2>References</h2> <p>To learn the component parts of this class, I used the following resources:</p> <h3>Simple Collision</h3> <p>[1] <a href="https://www.lexaloffle.com/bbs/?tid=3116">https://www.lexaloffle.com/bbs/?tid=3116</a> by <a href="https://www.lexaloffle.com/bbs/?uid=12235">Scathe</a></p> <h3>Gravity</h3> <p>[2] <a href="https://www.youtube.com/watch?v=wg2l0y6cvNY">https://www.youtube.com/watch?v=wg2l0y6cvNY</a> by <a href="https://twitter.com/vinull"><a href="https://www.lexaloffle.com/bbs/?uid=31305"> @ViNull</a></a></p> <h3>Map Collision</h3> <p>[3] <a href="https://www.youtube.com/watch?v=Gs0XFViFxFs">https://www.youtube.com/watch?v=Gs0XFViFxFs</a> by <a href="https://twitter.com/DocRobsDev">@DocRobsDev</a></p> <h3>Animated Sprites</h3> <p>[4] <a href="https://pixelfrog-assets.itch.io/pixel-adventure-2">https://pixelfrog-assets.itch.io/pixel-adventure-2</a> by <a href="https://pixelfrog-assets.itch.io/">Pixel Frog</a></p> <h1>Want to contribute?</h1> <p>Head over to GitHub and open a pull request <a href="https://github.com/gcoulby/pico-8-reusable-actor"><a href="https://github.com/gcoulby/pico-8-reusable-actor">https://github.com/gcoulby/pico-8-reusable-actor</a></a></p> https://www.lexaloffle.com/bbs/?tid=52308 https://www.lexaloffle.com/bbs/?tid=52308 Mon, 03 Apr 2023 18:53:43 UTC &quot;RGB&quot; Color demo <p> <table><tr><td> <a href="/bbs/?pid=126905#p"> <img src="/bbs/thumbs/pico8_dufsomowi-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=126905#p"> dufsomowi</a><br><br> by <a href="/bbs/?uid=75363"> gcoulby</a> <br><br><br> <a href="/bbs/?pid=126905#p"> [Click to Play]</a> </td></tr></table> </p> <h1>What is this</h1> <p>This is just a simple tech demo. I was curious to see how recognisable an RGB image would be if it were mapped to the screen in the same way LED TVs/monitors draw colors with RGB.</p> <p>Since each fake pixel is 3<em>3px - this gives a grand usable screen space of 42</em>42px!!!!!</p> <hr /> <p>I went looking for 42*42 picture to experiment with and found this one (which I selected as it was the only one I could find that wasn't a person)</p> <p><img src="https://secure.gravatar.com/avatar/ea41f5aca8818b60437910c8cbc2e10f" alt="https://secure.gravatar.com/avatar/ea41f5aca8818b60437910c8cbc2e10f" /> 42px version: <img src="https://secure.gravatar.com/avatar/ea41f5aca8818b60437910c8cbc2e10f?s=42&amp;amp;d=mm&amp;amp;r=g" alt="https://secure.gravatar.com/avatar/ea41f5aca8818b60437910c8cbc2e10f?s=42&amp;d=mm&amp;r=g" /></p> <p>RGB data was converted to a Lua table using a simple python script: <a href="https://colab.research.google.com/drive/1DrwY74iLzNmt3H5f2VX2sG0UDQxsSFh-?usp=sharing"><a href="https://colab.research.google.com/drive/1DrwY74iLzNmt3H5f2VX2sG0UDQxsSFh-?usp=sharing">https://colab.research.google.com/drive/1DrwY74iLzNmt3H5f2VX2sG0UDQxsSFh-?usp=sharing</a></a></p> <hr /> <h1>How this works</h1> <p>Each fake &quot;pixel&quot; is made up of a 3*3px bars of R G B . </p> <p>To achieve this effect I created a custom color palette, which just focused on RGB values. I did try to experiment with Black and White for extreme values, but I wasn't happy with the results. I added a flag that allows you to switch modes between the image and palette. </p> <p>Each &quot;pixel&quot; is draw with 3 <code>rectfill()</code> that are stacked vertically and each RGB value is mapped from 0-255 to 4 discreet values `{63,128,191,255}.</p> <p>The RGB values are then drawn to each 3*3 &quot;pixel&quot; on the screen. </p> <hr /> <h1>Outcomes</h1> <p>Does this have any practical value?<br /> &gt; <em>if you shrink the console down to around 42px it looks similar to the original</em> </p> <p>&gt; <em>However, this method uses 7439 tokens to draw a 42</em>42px image to the screen 😂</p> <p>Was it worth doing? </p> <ul> <li>I think so. I've only had the pico-8 a couple of days, so I am trying to learn what I can. So this taught me about how to exploit <code>pal()</code>. </li> </ul> https://www.lexaloffle.com/bbs/?tid=51960 https://www.lexaloffle.com/bbs/?tid=51960 Fri, 10 Mar 2023 13:51:56 UTC Domination <p> <table><tr><td> <a href="/bbs/?pid=126847#p"> <img src="/bbs/thumbs/pico8_jubibeyewe-3.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=126847#p"> Domination</a><br><br> by <a href="/bbs/?uid=75363"> gcoulby</a> <br><br><br> <a href="/bbs/?pid=126847#p"> [Click to Play]</a> </td></tr></table> </p> <p>This is my first PICO-8 game. I thought I would remake a Nintendo GameBoy game I made, which I was planning on redoing anyway, as I was not happy with the interrupt handlers. </p> <p>However, I am glad I bought the PICO-8 license, as this has been a fantastic experience. </p> <p>The source code for the project is available at <a href="https://github.com/gcoulby/domination-p8"><a href="https://github.com/gcoulby/domination-p8">https://github.com/gcoulby/domination-p8</a></a></p> <h2>Instructions</h2> <hr /> <p>The goal of the game is to have the most cards.</p> <p>You play a card by moving the cursor in your hand with ⬅️➡️ and pressing 🅾️ to select a card.</p> <p>Select an available slot on the board and press 🅾️ to play it.</p> <p>Cards can be won by placing your card adjacent to an opponent's card.</p> <p>When the values on your card are &gt; or = to adjacent values on your opponent's card, you win their card.</p> <p>This effect can cascade when you win a card! When a card is won adjacencies are then evaluated accordingly, for the newly aquired card. however, this cascade can only happen once and only if the values on your new card are &gt; the adjacent vales on the next layer of opponent cards.</p> <p>You win the round by having the most cards when the last card is played. enjoy!</p> <p> <table><tr><td width=32> <img src="https://www.lexaloffle.com/bbs/gfxc/75363_0.png" width=32 height=32> </td> <td valign=bottom> <a style="cursor:pointer;font-size:8pt" onclick=' var el = document.getElementById("gfxcode_75363_0"); if (el.style.display == "none") el.style.display = ""; else el.style.display = "none"; microAjax("https://www.lexaloffle.com/bbs/gfxc/75363_0.txt", function (retdata){ var el = document.getElementById("gfxcode_75363_0"); el.innerHTML = retdata; el.focus(); el.select(); } ); '> [8x8]</a> </td></tr> <tr><td colspan=2> <textarea rows=3 class=lexinput id="gfxcode_75363_0" style="width:640px;background-color:#fed;display:none;overflow:hidden; font-size:6pt;"></textarea> </td> </tr> </table> </p> https://www.lexaloffle.com/bbs/?tid=51933 https://www.lexaloffle.com/bbs/?tid=51933 Thu, 09 Mar 2023 17:15:25 UTC