JRJurman [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=70382 Blind Accessible Games in Pico-8 <p>I wanted to share a few projects that I've been working on to prove out that making low-vision / blind accessible games is possible in PICO-8!</p> <p>To get to the meat of it, here are the two games that my friend and I were able to put together that we built in prep for, and as a submission to the <a href="https://itch.io/jam/games-for-blind-gamers-3">Games for Blind Gamers</a> game jam:<br /> Tiger &amp; Dragon - <a href="https://jrjurman.itch.io/tiger-dragon">https://jrjurman.itch.io/tiger-dragon</a></p> <img style="margin-bottom:16px" border=0 src="/media/70382/tg_a11y_screenshot.png" alt="" /> <p>Lunch Gambit - <a href="https://jrjurman.itch.io/lunch-gambit">https://jrjurman.itch.io/lunch-gambit</a></p> <img style="margin-bottom:16px" border=0 src="/media/70382/lg_a11y_screenshot.png" alt="" /> <p>The games require a screen reader if you want to hear the text being read aloud, but the long and short of it is that the text on the right will be read out to screen readers. For people who might have trouble reading the text or need especially large fonts, the right side panel respects the font-size of the page, and allows players to zoom in if that would help readability.</p> <p>The way that we were able to accomplish this is by having a special HTML template that reads the GPIO output from PICO-8 - <a href="https://github.com/JRJurman/pico-a11y-template">pico-a11y-template</a></p> <p>There is a chunk of code from the pico-a11y-template project that needs to be copied into the cart, but once you've done that, then you get access to a couple of methods that interact with the page and allow you to send text in a way that screen readers will be able to pick up.</p> <p><code>set_sr_text(text)</code> is the main method to set screen reader text, and allows you to send text (of any size) to the web page to be read out. That text will be loaded into a text element on the web page, which will alert screen readers (if the text has updated).</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>if (btnp(🅾️)) then counter = 0 set_sr_text(&quot;counter reset&quot;) 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>There is a required <code>update_sr()</code> that handles the processing of larger text chunks, and finally there is a <code>handle_pause_sr()</code> - frustratingly, the default pause menu isn't (and can't be made from what I can tell) accessible by any means, so the best we can do is alert the user that the game has been paused, and when they unpause reset the text readout to what it was before.</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 _update() -- your game logic ... update_sr() handle_pause_sr() end</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <img style="margin-bottom:16px" border=0 src="/media/70382/lg_pause_screenshot.png" alt="" /> <p>Accessibility is a spectrum, so aside from using this, we decided to use the <a href="https://v3x3d.itch.io/tomorrow-night">Tomorrow Night font from VEXED</a> for Lunch Gambit, so that low vision users who might not need a screen reader would be able to read the text in the PICO-8 window. This limited the amount of text we could fit on the screen, but was worthwhile to make the game accessible to those who might have issues reading the low resolution font built in.</p> <img style="margin-bottom:16px" border=0 src="/media/70382/lg_font_text_screenshot.png" alt="" /> <p>From the feedback so far, it seems like there were no issues from Blind Gamers on playing these games in Pico-8, so I hope that this library opens up the kinds of games possible in Pico-8, and the total number of games available to those with low-vision </p> https://www.lexaloffle.com/bbs/?tid=140773 https://www.lexaloffle.com/bbs/?tid=140773 Sun, 17 Mar 2024 06:43:38 UTC Online Multiplayer for Pico-8 using pico-socket <p> <table><tr><td> <a href="/bbs/?pid=119485#p"> <img src="/bbs/thumbs/pico8_pico_pong_online-3.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=119485#p"> pico_pong_online</a><br><br> by <a href="/bbs/?uid=70382"> JRJurman</a> <br><br><br> <a href="/bbs/?pid=119485#p"> [Click to Play]</a> </td></tr></table> </p> <p>NOTE: In order to play this game online, go to <a href="https://pico-pong-online.herokuapp.com/">https://pico-pong-online.herokuapp.com/</a></p> <p>This game is one example of how to make online multiplayer games with <a href="https://github.com/JRJurman/pico-socket">pico-socket</a>, a new library that I've been working on, that came out of a collaborative project with Ethan Jurman and his <a href="https://github.com/ethanjurman/pico-tiny-tanks">Tiny Tanks game</a></p> <p>You can read some of the finer details about the pong game here: <a href="https://github.com/JRJurman/pico-pong-online">https://github.com/JRJurman/pico-pong-online</a></p> <p>For a smaller example, and details around the library, and how to use it, check out the project <a href="https://github.com/JRJurman/pico-socket">on github</a>. Below is an abridged version of the README and how it works:</p> <h1>pico-socket</h1> <p>Server and Client library for adding Online Multiplayer to Pico-8</p> <h2>What is it?</h2> <p>pico-socket is a library that allows multiple Pico-8 web clients (HTML export)<br /> to talk to each other via websockets. Once the data has reached each client, it<br /> is loaded in the Pico-8 environment using GPIO addresses.</p> <h2>Simple Example</h2> <p>In your Pico-8 game, use GPIO addresses as a substitute for game state, using<br /> <code>PEEK</code> and <code>POKE</code> to access data for the different players.</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>room_id_addr = 0x5f80 -- index 0 player_id_addr = 0x5f81 -- index 1 player_0_y_addr = 0x5f82 -- index 2 player_1_y_addr = 0x5f83 -- index 3 function _init() poke(room_id_addr, 0) -- hard code to 0 poke(player_id_addr, 0) -- start as player 0 poke(player_0_y_addr, 64) poke(player_1_y_addr, 64) end function _update() player_addr = 0 if (peek(player_id_addr) == 0) player_addr = player_0_y_addr if (peek(player_id_addr) == 1) player_addr = player_1_y_addr -- move up and down cur_y = peek(player_addr) if (btn(⬆️)) poke(player_addr, cur_y-1) if (btn(⬇️)) poke(player_addr, cur_y+1) -- swap player id if (btnp(❎)) poke(player_id_addr, 0) if (btnp(🅾️)) poke(player_id_addr, 1) end function _draw() cls() rect(40, peek(player_0_y_addr), 44, peek(player_0_y_addr)+4, 12) rect(88, peek(player_1_y_addr), 92, peek(player_1_y_addr)+4, 8) 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>Outside of Pico-8, all you need to do is make a javascript file that<br /> pulls in the pico-socket library and calls <code>createPicoSocketServer</code>.</p> <p>You will need to pass in specific configuration based on your game, but besides the config, nothing else is required. The below snippet is the entire file you need for getting a service running locally or on a cloud<br /> service like Heroku.</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>const { createPicoSocketServer } = require(&quot;pico-socket&quot;); createPicoSocketServer({ assetFilesPath: &quot;.&quot;, htmlGameFilePath: &quot;./sample.html&quot;, clientConfig: { roomIdIndex: 0, // ROOM_ID // index to determine the player id playerIdIndex: 1, // PLAYER_ID // indicies that contain player specific data playerDataIndicies: [ [2], // PLAYER_0_Y [3], // PLAYER_1_Y ], }, });</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>And that's it! Running this javascript file with NodeJS will start a server, that you can connect to. You can run this on your own hardware if you are familiar with setting up servers or LAN setups that other people can connect to. You can also use a cloud service like Heroku to fairly trivially deploy and host your games.</p> https://www.lexaloffle.com/bbs/?tid=49891 https://www.lexaloffle.com/bbs/?tid=49891 Sun, 23 Oct 2022 22:56:37 UTC Pico-Drawer-9000 <p> <table><tr><td> <a href="/bbs/?pid=118851#p"> <img src="/bbs/thumbs/pico8_pico_drawer_9000-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=118851#p"> pico_drawer_9000</a><br><br> by <a href="/bbs/?uid=70382"> JRJurman</a> <br><br><br> <a href="/bbs/?pid=118851#p"> [Click to Play]</a> </td></tr></table> </p> <p>Simple etch-a-sketch clone for the Pico-8, was used to get familiar with Pico-8 development - feel free to load, read the code, and remix!</p> https://www.lexaloffle.com/bbs/?tid=49735 https://www.lexaloffle.com/bbs/?tid=49735 Sun, 09 Oct 2022 20:09:54 UTC