arashi256 [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=22217 My steering code occasionally goes crazy <p>Can somebody explain why my steering code (well, <a href="https://www.lexaloffle.com/bbs/?uid=16330"> @2darray</a>'s mostly) sometimes goes bananas and sine's itself off-screen rather than heading to the next waypoint? It only happens occasionally and I can't see why and always to the left.</p> <p> <table><tr><td> <a href="/bbs/?pid=64258#p"> <img src="/bbs/thumbs/pico8_nokikfiyu-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=64258#p"> Waypoint2</a><br><br> by <a href="/bbs/?uid=22217"> arashi256</a> <br><br><br> <a href="/bbs/?pid=64258#p"> [Click to Play]</a> </td></tr></table> </p> <p>Sometimes it'll do this...</p> <img style="" border=0 src="https://www.lexaloffle.com/bbs/files/22217/waypoint-error-2.gif" alt="" /> <p>Would greatly appreciate any help and a math explanation. It seems to happen more often if I decrease the turning speed from say </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> turnspeed=2*(pi/180) </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>to </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> turnspeed=0.5*(pi/180) </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>but that doesn't explain the example gif because the distance between node 5 and 6 is quite far.</p> <p>Edit: I've uploaded a version with a simpler sprite and a vector to show the current target node. </p> https://www.lexaloffle.com/bbs/?tid=34162 https://www.lexaloffle.com/bbs/?tid=34162 Thu, 09 May 2019 13:58:47 UTC Android Chrome audio stutter <p>Apologies if this is common knowledge and I asked on Twitter as well, but...</p> <p>Is it just me or does anybody else get extreme audio stuttering on Android with Chrome on the web export? This has happened across three diffferent phones and three Pico8 versions. Audio is fine on Samsung's browser and Edge mobile. Was there ever a fix for this that I missed?</p> https://www.lexaloffle.com/bbs/?tid=34129 https://www.lexaloffle.com/bbs/?tid=34129 Fri, 03 May 2019 11:11:48 UTC Road Storm <p> <table><tr><td> <a href="/bbs/?pid=53292#p"> <img src="/bbs/thumbs/pico53607.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=53292#p"> Road Storm 1.1</a><br><br> by <a href="/bbs/?uid=22217"> arashi256</a> <br><br><br> <a href="/bbs/?pid=53292#p"> [Click to Play]</a> </td></tr></table> </p> <p>1.1 update: </p> <ul> <li>Code optimisation</li> <li>Muted alert sound for low fuel/ammo</li> <li>Reinstated original title screen (much better!)</li> <li>Added btn(5) X as alternative acceleration button for those using joypads/sticks.</li> </ul> <p>My third little game - an arcade racer / shooter a bit like RoadBlasters, which was a favourite of mine as a kid.</p> <p>Up = Accelerate<br /> Down = Brake<br /> Left/Right = Turn left / right<br /> Z = Shoot<br /> X = Alternative accelerate</p> <p>Hope you enjoy it. Don't bother asking for improvements, I'm at the token limit :D On to the next thing!</p> https://www.lexaloffle.com/bbs/?tid=31379 https://www.lexaloffle.com/bbs/?tid=31379 Tue, 05 Jun 2018 11:57:28 UTC Weapons help <p> <table><tr><td> <a href="/bbs/?pid=52773#p"> <img src="/bbs/thumbs/pico52771.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=52773#p"> Weapons help</a><br><br> by <a href="/bbs/?uid=22217"> arashi256</a> <br><br><br> <a href="/bbs/?pid=52773#p"> [Click to Play]</a> </td></tr></table> </p> <p>Hi,</p> <p>I am reduced to asking for help with the above. Pressing Z fires projectiles to a target XYZ that is Z+10 units &quot;into&quot; the screen (denoted as white targets). This is fine when the target X matches the source X (the player, basically) but when firing to the sides (+/- 150 units) the speed is very slow and I'm somehow able to fire much faster than I should be able to. </p> <p>The relevant stuff is in update_bullets(). </p> <p>I'm using a fairly standard algo for moving towards a target that I'm pretty sure I used before for 2D stuff but I can't make it work in &quot;3D&quot;. I assumed you just swapped out the Y for the Z. </p> <p>Can somebody help me out? </p> <p>Z = Fire<br /> Left,Right = Shift the targets 150 units to the left or right.</p> https://www.lexaloffle.com/bbs/?tid=31292 https://www.lexaloffle.com/bbs/?tid=31292 Tue, 15 May 2018 07:56:37 UTC The stat() function - memory and CPU (and a few other Q's) <p>Hi guys,</p> <p>So I'm developing my third game and actually reading the docs this time around and I'm now using the stat() function to see what's going on as I code. </p> <p>I've got about 284 lines of code and a spritesheet of 785 bytes. No music or sound effects. Yet my mem usage is 43MB according to stat(0). Isn't...that a lot? Seems like a lot. What's going on here? Is it measuring the entire PICO-8 development environment usage or just my code?</p> <p>Also, stat(1) for CPU usage from the docs states that a value of 1.0 is the program executing 100% of the time between frames, whereas anything over 1.0 is basically frame-skipping due to excessive load. I've of a value of 0.19. I'm guessing anything under 1.0 is &quot;this is way easy, what else you got?&quot; from the CPU, correct?</p> <p>I've also been looking at the PICO-8 cheat-sheet and noticed the memory layout. And I know people use peek/poke/memcpy/memset to do....stuff. Why would I need to know the memory layout for PICO-8 and why is manually fiddling with the memory desirable? Procedurally generated graphics? Anything else?</p> <p>Thanks!</p> https://www.lexaloffle.com/bbs/?tid=30651 https://www.lexaloffle.com/bbs/?tid=30651 Wed, 24 Jan 2018 14:40:26 UTC Dawn of Nuke <p> <table><tr><td> <a href="/bbs/?pid=42132#p"> <img src="/bbs/thumbs/pico42131.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=42132#p"> Dawn of Nuke 1.0</a><br><br> by <a href="/bbs/?uid=22217"> arashi256</a> <br><br><br> <a href="/bbs/?pid=42132#p"> [Click to Play]</a> </td></tr></table> </p> <p>My second game - my version of Missile Command. I learned a fair bit doing this one so I hope you like it :D<br /> Much like nuclear war, there is no win state, you just survive as long as you can whilst things get progressively more difficult. </p> <p>The aim is to keep your cities safe from ICBM attack. You have a limited number of ABM missiles. As long as one city survives each wave, you can continue. Destruction of ABM launch silos means you cannot use it although they are more hardened than cities against a direct impact. Bonuses are awarded for each surviving city. </p> <p>Controls: </p> <p>Z to start game<br /> X to fire ABM missiles</p> <p>This is so much fun, on to the next project! </p> https://www.lexaloffle.com/bbs/?tid=29580 https://www.lexaloffle.com/bbs/?tid=29580 Sat, 01 Jul 2017 18:50:37 UTC Self-hosted games not the same as BBS on mobile <p>Hi, sorry if this is a stupid question because I'm not really a web developer but I've hosted my game on my own site and it doesn't behave the same as the same game hosted here. Desktop is fine but on mobile, the on-screen touch controls are missing and I have to pinch to zoom to get the game to fill the window while on here it fits neatly even without using full-screen mode.<br /> Can someone point me in the right direction? I'd like my Pico8 games pages to be mobile-aware.</p> <p>I don't know if this is something I need to change with the export or what. I'm game to learn &quot;proper&quot; web development....I know some basic HTML and that's it but I'm up for getting my hands dirty if someone can point me in the right direction.</p> <p>Also as an aside, I couldn't figure out how to post here without switching mobile Chrome to the desktop version. You can't seem to post otherwise.</p> https://www.lexaloffle.com/bbs/?tid=29073 https://www.lexaloffle.com/bbs/?tid=29073 Thu, 30 Mar 2017 13:45:23 UTC Standard 2D gamedev resources? <p>I know this isn't strictly speaking Pico-8 related but I'm not much of a programmer and I get the feeling that a lot of the clever techniques that I see used here are...um...algorithmically standard things in terms of doing 2D graphics and movements and things like that and can probably be used in any 2D game programming language/library.<br /> Does anyone know of any 2D gamedev resources to learn more that explain the math/algorithms involved in simple 2D games and effects? I've done exactly one game in Pico8 and it took a very long time because I don't know how to implement things that appear to be standard 2D videogamey things. Absolutely everything I know about game programming is in that game and it's basically just Pong (again).</p> <p>Sorry for the off-topicness and potentially vague question.</p> https://www.lexaloffle.com/bbs/?tid=29062 https://www.lexaloffle.com/bbs/?tid=29062 Tue, 28 Mar 2017 15:12:27 UTC Space Picanoid <p> <table><tr><td> <a href="/bbs/?pid=38727#p"> <img src="/bbs/thumbs/pico38726.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=38727#p"> Space Picanoid 1.0</a><br><br> by <a href="/bbs/?uid=22217"> arashi256</a> <br><br><br> <a href="/bbs/?pid=38727#p"> [Click to Play]</a> </td></tr></table> </p> <p>First Pico-8 game. Sorry it's Pong/Arkanoid again :) This is pretty much done simply because I can't think of anything else to add. I had to learn Lua at the same time so the code is probably pretty horrible. I'll update it for bug fixes and that but I'm probably going to move onto something else after this.</p> <ul> <li>16 levels. </li> <li>7 power ups.</li> <li>Persistent high-score. </li> <li>Whizzy particles. </li> </ul> <p>Yeah, I guess that's it. Many thanks to the Pico-Hero guy for getting me started.</p> https://www.lexaloffle.com/bbs/?tid=29051 https://www.lexaloffle.com/bbs/?tid=29051 Sat, 25 Mar 2017 14:52:03 UTC Recording animated GIF in Linux <p>Hi, </p> <p>I'm trying to record an animated GIF under Linux in PICO-8. It records it fine according to PICO-8, but I have no idea where the file is located. I've done a file search for GIFs under my user directory and nothing turns up. Nothing under $HOME/Desktop where I'd expect it to be.</p> <p>Little help?</p> https://www.lexaloffle.com/bbs/?tid=29049 https://www.lexaloffle.com/bbs/?tid=29049 Sat, 25 Mar 2017 09:30:22 UTC