2bitchuck [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=14590 Recent web player update weirdness <p>On the scale of important problems, I understand that this probably rates super low, but with the recent web player update, part of the start screen of one of my games has vanished. I'll show you what I mean. Here is the title screen of my cart as seen in the cover image:</p> <img style="" border=0 src="/media/14590/Screen Shot 2021-01-24 at 5.27.18 PM.png" alt="" /> <p>And here is what you see in the current web player (0.2.1c.21):</p> <img style="" border=0 src="/media/14590/7_Screenshot_20210124-172028.jpg" alt="" /> <p>The road that the cars are on is gone. This happens on both mobile and desktop.</p> <p>I haven't updated the cart for about 3 months, and obviously I don't have this version to test with locally to see if it's something I need to change in my code to account for a feature change. I'm pretty sure that I'm the only one that plays my games, so not a huge deal for me personally, but I wanted to flag it in case this is happening to anyone else with a bigger audience.</p> https://www.lexaloffle.com/bbs/?tid=41271 https://www.lexaloffle.com/bbs/?tid=41271 Sun, 24 Jan 2021 22:34:50 UTC Apparitional Abode <p> <table><tr><td> <a href="/bbs/?pid=86002#p"> <img src="/bbs/thumbs/pico8_appabode-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=86002#p"> appabode</a><br><br> by <a href="/bbs/?uid=14590"> 2bitchuck</a> <br><br><br> <a href="/bbs/?pid=86002#p"> [Click to Play]</a> </td></tr></table> </p> <p>This is a PICO-8 remake of the Atari 2600 game Haunted House! Can you collect the 3 pieces of treasure and escape the house before losing all your lives or running out of matches? How quickly can you do it?</p> <p>Use X/Z to light a match - be warned, it won't stay lit for long! You can't see treasure or keys without light, and you can't pick up what you can't see. The monsters in the house will pursue you and will blow out your match if they get close. If they catch you, they'll steal your key and treasure to hide them in the house again.</p> <p>Use left &amp; right arrows on the title screen to toggle match flicker on and off. If you are a player for whom flashing lights/colors can trigger seizures, you'll want to turn the flicker off.</p> <p>This game was made for Toy Box Jam 2020! All of the sprite and sound assets were created by others and everyone in the jam uses the same assets to make their games. Info on the jam and credits for all the assets provided to the participants can be found on <a href="https://itch.io/jam/toy-box-jam-2020">the jam's itch.io page</a>.</p> <p>A huge thank you to the following folks for some of the code used in the game that they generously released under Creative Commons licensing!</p> <ul> <li> <p><a href="https://www.lexaloffle.com/bbs/?tid=3131">A* pathfinding code</a> by <a href="https://www.lexaloffle.com/bbs/?uid=5758"> @richy486</a> </p> </li> <li> <p>Fade code from <a href="https://www.lexaloffle.com/bbs/?tid=31484">Breakout Hero</a> by <a href="https://www.lexaloffle.com/bbs/?uid=16423"> @Krystman</a></p> </li> <li>Circle map from this <a href="https://www.lexaloffle.com/bbs/?tid=38881">Lighting Functions</a> example by <a href="https://www.lexaloffle.com/bbs/?uid=42963"> @cubee</a></li> </ul> <p>There are probably bugs, but I've played a fair bit without a crash, so that's something at least :). So let me know in the comments how you did - time, matches &amp; deaths!</p> https://www.lexaloffle.com/bbs/?tid=41016 https://www.lexaloffle.com/bbs/?tid=41016 Fri, 01 Jan 2021 01:42:44 UTC Music only plays one SFX per pattern <p>I have a weird thing going on that I'm 100% sure is because of something I'm doing wrong, but I can't quite figure it out. Hoping one of you will have some insight!</p> <p>When I run my cart, I have a title screen music track that plays using music(X), then fades out using music(-1,500) when the user presses X/Z to start the game. There's an intro cut scene where a different track plays using music(Y) then fades out when that cut scene ends, also using music(-1,500). The user plays, there's no music during the game but there are a variety of SFX that play from time to time. When the user wins or loses, there's another cut scene that plays music(Y) - however, for whatever reason, it only plays one of the 2 SFX in the pattern this time around. When that cut scene is done, the user gets the score screen, which plays either music(X) or music(Z) depending on whether the user wins or loses, but again only one SFX in the pattern plays. The user can then press X or Z to go back to the title screen, and music(X) only plays one of the 3 SFX in that pattern.</p> <p>I suspect that somewhere, something's not getting cleared from a channel and that's preventing the rest of the SFX from playing, but I am not sure how to figure out what I'm doing wrong or how to fix it. Is there any guidance anyone can offer from this vague description? This is for my Toy Box Jam game, so if I can't figure it out before the deadline, I may end up posting it with &quot;broken&quot; music and maybe somebody can help me figure it out from my specific messy code so I can fix it post-release :).</p> <p>For TL;DR - the flow that leads to this condition is basically:</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>music(X) --title screen, plays all 3 SFX, player presses X/Z music(-1,500) --fades music(Y) --plays both SFX, fade starts when scene ends music(-1,500) --fades gameplay with various SFX but no music playing until lose condition music(Y) --plays only leftmost SFX in pattern, fade starts when scene ends music(-1,500) --fades music(Z) --plays only leftmost SFX in pattern, player presses X/Z music(X) --title screen, plays only middle SFX in pattern</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> https://www.lexaloffle.com/bbs/?tid=40996 https://www.lexaloffle.com/bbs/?tid=40996 Wed, 30 Dec 2020 19:36:18 UTC Token optimization tutorial? <p>Does anyone know if there are any good token optimization tutorials out there? Something like a collection of tips that show a suboptimal way of doing something and then demonstrate an optimized equivalent?</p> <p>I'm about 25% through my latest game but about 60% through my token count already. Ordinarily I am much more inclined to finish functionality first and optimize/polish later, but in this case there is no way I will be able to finish if I don't clean up because I'll run out of tokens well before everything is in.</p> <p>I suspect most of my problem is that I have a lot of tables and nested tables, 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>-- this is 76 tokens total and I have a total of about 608 tokens worth of just these ryl = (yl + (flr(yl/10)*1.5))*7.84 rec={rec1={x=ryl,ogx=ryl,y=32,ogy=32,sx=0,sy=32,speed=rnd(1.25),f=false},rec2={x=ryl,ogx=ryl,y=111,ogy=111,sx=0,sy=32,speed=rnd(1.25),f=false}}</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>which I then refer to values of like this (adding another 26 tokens): <span style=" display:inline-block; background-color:#eee; padding:2px; margin: 4px; padding-left: 8px; padding-right: 8px; color:#222">sspr(oteam.rec.rec1.sx,oteam.rec.rec1.sy,sprw,sprh,oteam.rec.rec1.x,oteam.rec.rec1.y,sprw,sprh,oteam.rec.rec1.f) </p> <p>There are obvious things I could do here, like shoving &quot;oteam.red.rec1&quot; into something more compact so it's a single token instead of 3 every time, but I'm hoping there are more &quot;best practices&quot; sorts of things folks could point me to for general token savings and more proper ways to deal with data structures like this.</p> https://www.lexaloffle.com/bbs/?tid=40043 https://www.lexaloffle.com/bbs/?tid=40043 Mon, 26 Oct 2020 15:04:14 UTC Memory <p> <table><tr><td> <a href="/bbs/?pid=82286#p"> <img src="/bbs/thumbs/pico8_memory_2bc-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=82286#p"> memory_2bc</a><br><br> by <a href="/bbs/?uid=14590"> 2bitchuck</a> <br><br><br> <a href="/bbs/?pid=82286#p"> [Click to Play]</a> </td></tr></table> </p> <p>I was working on a grid layout sector map for another project, but all I could think of was how the grid reminded me of the classic matching game Memory (or Concentration in some locales). So to get that out of my system so I could move on with my space game, I stopped and made a quick &amp; dirty version of Memory.</p> <p>Use the arrow keys to navigate the grid, X to flip a tile, Z to toggle show/hide the time clock (useful if you want to see how close you are to a personal best). When you match two tiles, they'll stay flipped. When you match all 16, the game is over! Try to see how fast you can match all 16 tiles. My personal best is 30 seconds, but I'm sure it can be done faster. I blame my arthritis for my performance :).</p> <p>Unless there's a game breaking bug, I probably won't bother updating this. Like I said, this was mostly to get the thought of this game out of my head so I could keep making the game I'm actually trying to make! This was a fun diversion for a few hours though, and even though some of the sprites are hot garbage, I'm pretty fond of some of them (the snake, one-eyed demon head, and spider crab).</p> https://www.lexaloffle.com/bbs/?tid=39736 https://www.lexaloffle.com/bbs/?tid=39736 Sat, 26 Sep 2020 03:28:04 UTC KiloWar 1.0 <p> <table><tr><td> <a href="/bbs/?pid=81787#p"> <img src="/bbs/thumbs/pico8_kilowar-3.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=81787#p"> kilowar</a><br><br> by <a href="/bbs/?uid=14590"> 2bitchuck</a> <br><br><br> <a href="/bbs/?pid=81787#p"> [Click to Play]</a> </td></tr></table> </p> <p>===UPDATES===<br /> v1.0 - Played through about 200 matches (seriously) to find and fix the last couple of bugs hopefully (a race condition on coup fourr&eacute; where you could end up with 8 cards in hand, hear the coup fourr&eacute; sound, but not actually get the coup fourr&eacute; and a condition where CPU could run out of cards first and leave the player unable to play or discard, thus effectively stopping the game). I had originally planned to update the sprites, but I honestly like them as is, so I'm keeping them!</p> <p>v0.9.2 - Bug fixes related to end game no-winner nil conditions where player runs out of cards before CPU because player played one or more safeties after the deck ran out.</p> <p>v0.9.1 - Fixed unchecked nil bug in case where CPU gets coup fourr&eacute; with the emergency card and also has a Go card in hand (obscure devil of a bug!)</p> <p>===ORIGINAL POST===</p> <p>Hello everyone!</p> <p>I made a PICO-8 version of the classic French car racing card game Mille Bornes! This is a game I've probably played thousands of times in my life from childhood through . . . not childhood (age is just a number, but it's a BIG number!)</p> <p>In the game, you race against a CPU opponent to be the first to reach 700km (or, if you feel daring, extend the race to 1000km for a chance at bonus points). In addition to 1 point per km, you gain bonuses for playing safety cards, getting coup fourr&eacute; (playing a safety card as the corresponding hazard is being played against you), winning a race without playing any 200km cards, extending to 1000km, winning after the deck has been emptied, and shutting out your opponent. You race until someone totals 5000 points and wins the match! You can see the cards and a brief rules description by pressing z on the start screen.</p> <p>During the game, left &amp; right arrows let you select a card to play or discard. x plays a card, z discards. The up arrow lets you play coup fourr&eacute; if CPU plays a hazard for which you have the safety card. But be quick! You only have a short time to perform the coup fourr&eacute; while the indicator flashes.</p> <p>EDIT: I realized that the rules can be cumbersome to figure out if you've never played before. <a href="https://en.wikipedia.org/wiki/Mille_Bornes#Play">The Mille Bornes Wikipedia entry</a> is actually a pretty good reference for the game rules.</p> <p>This game is a lot of firsts for me: my first PICO-8 program, first experience with Lua, the first game programming of any kind I've done, first pixel art (quite obvious), first music composition (SUPER obvious). I'm proud of having created a fun, playable game, but it's very much the work of a game programing beginner, so don't expect highly optimized code or probably any techniques you should emulate :). I had 319 tokens left at the end and I'm sure there's plenty I could have done more efficiently.</p> <p>Special thank you to <a href="https://www.lexaloffle.com/bbs/?uid=16423"><a href="https://www.lexaloffle.com/bbs/?uid=16423"> @Krystman</a></a>, whose Breakout tutorial was my impetus to give this a go, and from which tutorial I shamelessly grabbed the sash code to use for coup fourr&eacute;. And thanks to everyone in this community. I think this is my first post, but I lurk &amp; read the posts here frequently, amazed at all the cool ideas you all have and how willing you are to share your knowledge.</p> https://www.lexaloffle.com/bbs/?tid=39580 https://www.lexaloffle.com/bbs/?tid=39580 Mon, 14 Sep 2020 02:24:44 UTC