makaGeorge [Lexaloffle Blog Feed] Star Trader's Luck 1.0.1 <p> <table><tr><td> <a href="/bbs/?pid=137288#p"> <img src="/bbs/thumbs/pico8_makasoft0001-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=137288#p"> Star Trader's Luck 1.0.1</a><br><br> by <a href="/bbs/?uid=84052"> makaGeorge</a> <br><br><br> <a href="/bbs/?pid=137288#p"> [Click to Play]</a> </td></tr></table> </p> <h1>Star Trader's Luck</h1> <h2>A digital dice game for 1-4 players</h2> <p>Hi all, I discovered Pico-8 about a week ago and after trying it out decided it was best to just develop something as I learn... So I took an old dice game I created way back and programmed a digital version with some animations and music to accompany.</p> <p>It uses your &quot;typical&quot; roll and re-roll dice mechanic, keeping at least one die each roll. In this case dice represent goods on a planet and the price for each good depends on the amount (supply) in that planet. You can travel to different sized planets and using the optional (and experimental) &quot;Economy&quot; rules, you can also choose between different types of planets that have different sets of dice. These new rules I came up with just now and might need to be adjusted...</p> <p>The rules (and a print and play version of the game) are available on <a href="">BGG</a> but the cart includes a short (and hard to read) summary... The game is pretty easy to pick up and play and will guide you through your turn...</p> <p>You can play solo and try to beat your highscore or play with up to 4 players. Actions take &quot;days&quot; to complete and the next player to play is always the one with the most days left. There's a mechanic where you can choose to go to the same planet the player before you went (with no re-rolls) by spending one more day to travel.</p> <p>The code is pretty messy and I'm not sure I'll ever clean it up... it could also be more efficient but I did this on the Pico-8 editor learning while programming, so... But as far as I can tell it does work...</p> <p>Any comments or bug reports are welcomed and I'll try to address them quickly...</p> <p>Edit: New version fixing a few bugs</p> Sat, 11 Nov 2023 20:58:18 UTC Dynamic loops for music playing (song mode) <p>Hi all,</p> <p>New here... just discovered this wonderful system yesterday... I still haven't experimented with actual game development on the platform, but did try the music tracker to check out its possibilities...</p> <p>While dabbling around with a simple idea for a song with different parts, I assumed I could define each part as a self contained loop and then from the code just switch parts as appropiate. For example: play the first part twice, then the second part twice and then the third part once.</p> <p>But when I went to search how that could be done I found no simple answer so I gave it a try and made two methods that both seem to work:</p> <ol> <li>Keep track of what pattern is playing and for how long and just when it's about to end use the music command to start playing the next part of the song. As the ticks received from the stat(56) change in jumps (the timing of music playing seems to be different than the one for the update function) you can't wait right unitl the end of the pattern, so I guess sometimes the jump might be noticeable. But the advantage is that you can switch to any other pattern freely...</li> </ol> <p> <table><tr><td> <a href="/bbs/?pid=136566#p"> <img src="/bbs/thumbs/pico8_pibuwiyego-2.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=136566#p"> Song mode 1</a><br><br> by <a href="/bbs/?uid=84052"> makaGeorge</a> <br><br><br> <a href="/bbs/?pid=136566#p"> [Click to Play]</a> </td></tr></table> </p> <ol start="2"> <li>Keep track of what pattern is playing and dynamically change the loop start/end flags using the poke command to keep looping a part until you want to go to the next part. This has the advantage that the timing is perfect but you can't structure your song freely. You always either go back to the begining of the current part or let it run into the next one.</li> </ol> <p> <table><tr><td> <a href="/bbs/?pid=136566#p"> <img src="/bbs/thumbs/pico8_niwowufopo-2.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=136566#p"> Song mode 2</a><br><br> by <a href="/bbs/?uid=84052"> makaGeorge</a> <br><br><br> <a href="/bbs/?pid=136566#p"> [Click to Play]</a> </td></tr></table> </p> <p>I put all the code into a function that initializes everything and retuns its own songupdate function to be called from _update, so it should be a matter of pasting it and defining the structure.</p> <p>Right now the speed has to be manually entered and be the same for the whole song. I guess it'd be possible to get it from memory for each pattern... </p> <p>Last, in the first method you have to set the loop flags on the tracker to define each section of the song, then define just the starting patterns for each section on the initial table. With the second method no loop flags should be set on the tracker and you define each section with the starting and ending pattern, adding a last section used to set the flags to go back to the begining of the song after it ends</p> <p>Let me know if there're other ways of acomplishing this or any problems you might see...</p> Sun, 29 Oct 2023 01:27:22 UTC