edo999 [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=12969 Animated background <p> <table><tr><td> <a href="/bbs/?pid=22121#p"> <img src="/bbs/thumbs/pico22119.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=22121#p"> Animated background 1.0</a><br><br> by <a href="/bbs/?uid=12969"> edo999</a> <br><br><br> <a href="/bbs/?pid=22121#p"> [Click to Play]</a> </td></tr></table> </p> <p>I looked into animating static background elements using different sprites and came up with this cart.</p> <p>Has anyone else tried to animate the background this way (that is without parallax scrolling, just animating some background sprites)? If so what approach would you recommend?</p> https://www.lexaloffle.com/bbs/?tid=3534 https://www.lexaloffle.com/bbs/?tid=3534 Thu, 02 Jun 2016 17:58:49 UTC PICO-8 not working in iOS in web app mode <p>PICO-8 carts exported to HTML won't work on iOS in web app mode (a.k.a full screen web app).<br /> Add the following meta tag to your .html file:</p> <div> <div style="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> &lt;meta name=&quot;apple-mobile-web-app-capable&quot; content=&quot;yes&quot;&gt; </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>Open the page in Safari iOS, add it to the homescreen, then launch it from there.</p> <p>Nothing happens, the execution of PICO-8 doesn't start though it works perfectly well when launched from Safari.</p> <p>The device I'm testing on, an iPhone 5, is not powerful enough to debug the web page and crashes when I try, so I don't really know what's the problem. I suspect there is a limitation blocking Emscripten somehow, maybe with the <span style=" display:inline-block; background-color:#eee; padding:2px; margin: 4px; padding-left: 8px; padding-right: 8px; color:#222">eval() function in JavaScript. I know the JIT was (is still?) disabled in webview, but the particularities of the web app mode are not documented.</p> <p>It's a shame that Apple is doing their best to ruin the HTML5 experience, probably to give the priority to their closed and controlled apps ecosystem.<br /> I'm not an iOS expert, so if you have any idea on how to fix that, please let me know.</p> https://www.lexaloffle.com/bbs/?tid=3460 https://www.lexaloffle.com/bbs/?tid=3460 Thu, 26 May 2016 19:36:21 UTC Pangaea <p> <table><tr><td> <a href="/bbs/?pid=20540#p"> <img src="/bbs/thumbs/pico20539.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=20540#p"> Pangaea 1.0</a><br><br> by <a href="/bbs/?uid=12969"> edo999</a> <br><br><br> <a href="/bbs/?pid=20540#p"> [Click to Play]</a> </td></tr></table> </p> <p>I made a small demo of a rotating globe. The texture effect works visually.<br /> Feel free to reuse the code to improve it or to make awesome games!</p> https://www.lexaloffle.com/bbs/?tid=3348 https://www.lexaloffle.com/bbs/?tid=3348 Fri, 13 May 2016 12:49:27 UTC Injecting data into a cart from a web page <p>When compiled to HTML, it was surprisingly easy to inject data inside a PICO-8 cart.</p> <p>The memory starting at 0x4300 (user data) maps to index 0x10DA1C of the heap in JavaScript. You can get and set the data easily using JavaScript (wait till the cart is loaded):</p> <div> <div style="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> Module.getValue(0x10DA1C); Module.setValue(0x10DA1C, 3); </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 read it or set in PICO-8 like this:</p> <div> <div style="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> peek(0x4300) poke(0x4300, 3) </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>I'm using it for a multiplayer game where I want to allow several players selection only when there is an internet connection (I haven't worked on the multiplayer communication yet though).</p> <p>The user data section is 6912 bytes long, so that's a lot of data for PICO-8.<br /> Potentially this technique can be used to do all sort of really cool things like leaderboard inside the cart, downloadable levels or players, syncing several players together (chat, collaboration games, multiplayer games...).</p> <p>Caveats:</p> <ul> <li>Not sure if the index in the heap will remain stable across releases. Is it even stable across carts? It must be decided by some internal logic in Emscripten.</li> <li>It works only in web mode of course.</li> <li>It works only when embedded in a particular web page.</li> </ul> https://www.lexaloffle.com/bbs/?tid=3339 https://www.lexaloffle.com/bbs/?tid=3339 Thu, 12 May 2016 16:32:30 UTC