camp39 [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=92361 hide_mouse_cursor bug <p>v0.2.6b<br /> The hide_mouse_cursor feature is very buggy. That is the option that makes the mouse cursor disappear while typing in the PICO-8 editor. Length in seconds can be configured in config.txt but the problem is there even with the default of 5 sec. </p> <p>On startup it works but after a while of coding it stops working at all. I posted this before but deleted my post because the steps I gave to reproduce didn't always make it happen. So it's hard for me to say exactly when it stops working. But I think that everyone here will notice if they pay attention, that after a some time working on a game, the mouse cursor will remain in the way while typing.</p> <p>If you <code>ctrl-r</code> <code>ctrl-r</code> it will start working again. But if you type something at the command prompt and say, get a syntax error, or even just <code>ls</code> to show whats in the directory, or <code>cls()</code>, most of the time (but not always!) when you esc back to the editor it will be broken and the mouse will show even while you are typing. This will persist for the rest of the session. <code>ctrl-r</code> TWICE seems to reset it, but once is not enough.</p> <p>I know this is a small thing, but once you notice it, its sort of annoying because of how nice it is when it is working. I've been coding directly in the editor lately. I used to think it was impossible but now I realize just how cool it is.</p> https://www.lexaloffle.com/bbs/?tid=144781 https://www.lexaloffle.com/bbs/?tid=144781 Thu, 17 Oct 2024 01:09:08 UTC gamepad support please...(Linux) <p>I bought a couple of bluetooth gamepads off Amazon:<br /> KIWITATA 2.4G Wireless NES USB Controller<br /> Which are imitation NES classic, 2-button, D-pad, select start controllers.</p> <p>It gets recognized right away by my latest Linux Mint OS and works in Pico-8<br /> EXCEPT that both buttons do the same thing (I think they are both X).</p> <p>I ran this code:</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 _draw() cls() ?btn() end --both B and A output 32</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 sure enough I get different values for all the buttons except both B1 and B2 print 32.</p> <p>I've found this thread <a href="https://www.lexaloffle.com/bbs/?tid=3623">https://www.lexaloffle.com/bbs/?tid=3623</a> where one poster talks about the same problem. But its from 2016 and was for pocketCHIP and they solved it by getting a different controller.</p> <p>I've also installed the <a href="https://www.generalarcade.com/gamepadtool/">SDL2 gamepad-tool for Linux</a> but had issues. It sort of works EXCEPT that it wont recognize left/right on the dpad. I tried a million times and also tried skipping and mapping it to the little joysticks instead but it didn't work.</p> <p>my understanding is that I am to copy/paste the resulting mapping line into<br /> .lexaloffle/pico-8/sdl_controllers.txt<br /> but haven't yet because it doesn't do me any good without right and left on the dpad.</p> <p>I've got to think this is a pretty easy fix in 2024. Any suggestions?</p> <p>Or at least, which NES classic style wireless controllers DO work?</p> https://www.lexaloffle.com/bbs/?tid=144033 https://www.lexaloffle.com/bbs/?tid=144033 Wed, 04 Sep 2024 02:59:17 UTC Solitaire Chess -- Vol. 1 <p> <table><tr><td> <a href="/bbs/?pid=153005#p"> <img src="/bbs/thumbs/pico8_solitaire_chess_vol1-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=153005#p"> Solitaire Chess -- Vol. 1</a><br><br> by <a href="/bbs/?uid=92361"> camp39</a> <br><br><br> <a href="/bbs/?pid=153005#p"> [Click to Play]</a> </td></tr></table> </p> <h1>Solitaire Chess</h1> <h3>About</h3> <p>68 solitaire chess puzzles. Drag and drop. Mouse only. Every move must be a capture, no check, king can be captured. Win by leaving only one piece. Lose if no remaining moves and more than one piece.</p> <p>There are two modes: puzzle rush and relax mode. Relax mode is recommended, but if you get to the end you don't get the winner screen and no points. In relax mode you can navigate to any puzzle by using the selector at top left and clicking &quot;GO&quot;. There is no clock or points and progress is not saved.</p> <p>In puzzle rush mode, points are based on how much time is left when a puzzle is completed. Each failure or reset of puzzle is minus 50 points. You can go negative and progress is saved. Clicking &quot;start fresh&quot; will delete all progress.</p> <p>Puzzles get harder and have more pieces but also more time as game continues.</p> <h3>Controls</h3> <ul> <li> <p>left mouse button: select, drag and drop</p> </li> <li> <p>middle mouse button: during game play, press for option button to reset puzzle. (so you don't need to play on when you know you are doomed.) hover and left or right click while holding middle button.<br /> (You will lose 25 points in puzzle-rush mode doing this).</p> </li> <li> <p>right mouse button: while piece is selected, right click on empty square to deselect piece. Or, while piece is selected, click on capture square to capture (useful to make multiple, consecutive captures without releasing selected piece).</p> </li> <li>menu: reset puzzle or toggle music on/off (each lose modal also has convenient music on/off button).</li> </ul> <h3>Credits</h3> <ul> <li> <p>The legal move generation was derived from Pico-Chess! cart #15045 by <a href="https://www.lexaloffle.com/bbs/?uid=11129"> @mrh</a>. It was very helpful and interesting.</p> </li> <li> <p>Easing functions from <a href="https://www.lexaloffle.com/bbs/?uid=26940"> @DocRobs</a> cart #58411 <a href="https://www.lexaloffle.com/bbs/?pid=58412#p">A selection of Easing Functions</a></p> </li> <li> <p>The opening theme song is my Pico-fied arrangement of <a href="https://freemusicarchive.org/music/caslo/caslo-vol-1/calling/"><em>Calling</em></a> by <a href="https://freemusicarchive.org/music/caslo/">Caslo</a>. <a href="https://creativecommons.org/licenses/by-nc-nd/4.0/">(License)</a></p> </li> <li> </li> </ul> https://www.lexaloffle.com/bbs/?tid=143779 https://www.lexaloffle.com/bbs/?tid=143779 Wed, 21 Aug 2024 04:40:38 UTC Mate In 2 -- Vol. 3 (mouse required) <p> <table><tr><td> <a href="/bbs/?pid=151986#p"> <img src="/bbs/thumbs/pico8_matein2vol3-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=151986#p"> matein2vol3</a><br><br> by <a href="/bbs/?uid=92361"> camp39</a> <br><br><br> <a href="/bbs/?pid=151986#p"> [Click to Play]</a> </td></tr></table> </p> <h1>Mate in 2 -- Vol. 3</h1> <h3>About</h3> <ul> <li>25 Mate-in-2 puzzles.</li> <li>Mouse required.</li> </ul> <h3>Controls</h3> <ul> <li>left mouse button : select / deselect pieces, squares or buttons.</li> <li>right mouse button: show hint-square during puzzle. hide modal after puzzle.</li> </ul> <h3>Upgrades from previous volumes</h3> <ul> <li>mouse makes for much better user experience.</li> <li>progress saved. start at last puzzle completed.</li> <li>white/black to move instead of just one color.</li> <li>improved wrong-move animation.</li> <li>expanded color palette.</li> <li>music (with easy on/off option at end of each puzzle).</li> </ul> <h3>Known bugs</h3> <ul> <li>if cart is left idle during a puzzle for a long time (like hours and hours), the wrong-move sprite animation gets messed up and instead of jiggling, the piece just drifts off to the side until returning to it's square. This is because <code>t()</code> is used with <code>cos()</code> to create the shake effect. When <code>t()</code> gets too big, it causes problems. It is within my tolerance level and so I don't mind. It never happens unless I forget that it is running all afternoon. Because this cart saves progress, it is no big deal to restart the cart. Or even play as-is since gameplay is not affected. In short, its a non-issue.</li> </ul> https://www.lexaloffle.com/bbs/?tid=143398 https://www.lexaloffle.com/bbs/?tid=143398 Wed, 31 Jul 2024 18:50:56 UTC sound effect during animation <p>little help?<br /> A sprite shakes if a certain condition is met and function called. I'd like to play a sound effect while it shakes. But I cant seem to make it play the whole sound effect because it starts over with each update and buzzes rather than plays. I can get the sound effect, or I can get the animation, but cant seem to make them both happen at the same time.<br /> I've tried many different variations and schemes, but here is one example:</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 _init() correct = nil tics = 30 end function _update() if (correct == false) shake() end function _draw() draw_stuff() end function shake() sfx(0) tics -= 1 if tics &gt; 0 then mysprite.x = mysprite.x + cos(t()/.1) --makes it shake back and forth else correct = nil tics = 30 end 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>I can see <em>why</em> it doesn't work; because it is calling the <code>sfx(0)</code> again and starting over every time <code>shake()</code> is called. But what is the right way of thinking about playing the sound along with an animation? I read about coroutines, but am not sure if that is actually needed for something this basic. I'd also like to just be able to call the function whenever I want and not bother checking in <code>_update()</code> every frame.<br /> I'll be grateful for any good example, tips, explanation or pointing in the right direction. Thank you.</p> https://www.lexaloffle.com/bbs/?tid=143144 https://www.lexaloffle.com/bbs/?tid=143144 Sun, 14 Jul 2024 08:15:46 UTC Variations: The Stafford Gambit <p> <table><tr><td> <a href="/bbs/?pid=150338#p"> <img src="/bbs/thumbs/pico8_stafford_gambit-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=150338#p"> Variations: The Stafford Gambit</a><br><br> by <a href="/bbs/?uid=92361"> camp39</a> <br><br><br> <a href="/bbs/?pid=150338#p"> [Click to Play]</a> </td></tr></table> </p> <h1>Variations: The Stafford Gambit</h1> <h3>Credits</h3> <ul> <li> <p>These variations come from the <a href="https://www.youtube.com/watch?v=nH_fiqlLp2U&amp;amp;list=PLdT3OotRiHJlIZw05EqVXpdn3M8qB7AJZ&amp;amp;index=1">Eric Rosen</a> youtube channel.<br /> (watch the link while practicing with this cart for maximum understanding)</p> </li> <li>Big thank you to <a href="https://www.lexaloffle.com/bbs/?uid=66501"> @Heracleum</a> for kindly going through one of my previous variation carts and teaching me how to properly make a data table. Its made more variations possible.</li> </ul> <h3>About</h3> <p>The Stafford Gambit is an objectively bad opening for black. But white has to play accurately which is very hard to do, giving lots of attacking chances, pins, traps, and nasty mates. Natural moves for white lead to certain doom. If you learn these 20 variations inside and out you will confuse many opponents and have a blast doing it. If your opponent really knows what they are doing, you may be in serious trouble!</p> <h3>Features</h3> <ul> <li>starting position is on move 3.Nxe5 for less repetition</li> <li>computer moves faster than previous, painfully slow variation carts</li> <li>hint button</li> <li>random variation selection</li> <li>menu navigation</li> <li>stockfish evaluation at end of each variation</li> </ul> <h3>Controls</h3> <p>❎ select/de-select piece and move-to square<br /> 🅾️ hold down during black's move to show a hint</p> https://www.lexaloffle.com/bbs/?tid=142834 https://www.lexaloffle.com/bbs/?tid=142834 Mon, 24 Jun 2024 06:20:34 UTC Variations: The Vienna <p> <table><tr><td> <a href="/bbs/?pid=148751#p"> <img src="/bbs/thumbs/pico8_variations_vienna-4.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=148751#p"> Variations: The Vienna</a><br><br> by <a href="/bbs/?uid=92361"> camp39</a> <br><br><br> <a href="/bbs/?pid=148751#p"> [Click to Play]</a> </td></tr></table> </p> <h1>Variations: The Vienna</h1> <h3>Description</h3> <p>16 variations of the Vienna opening played as white. These lines are chosen to be fun, for their attacking chances and dynamic play. They include common mistakes by black and how to punish them as well as how to respond to good play from your opponent. Practicing with this cartridge will give any player a good start to creating big problems for black with the Vienna!</p> <h3>Features</h3> <p>While none of white's moves are dubious, they are not necessarily the top engine recommendations. Because there is no 'right' move, a hint can be requested (see <em>Controls</em>). After completing a variation, the Stockfish evaluation is given. The player then has the options to either repeat the completed variation, move on to the next, or have the computer select a variation at random. The pause menu gives similar options but can be accessed at any time allowing the player to navigate to a specific variation or move to a new, random variation.</p> <h3>Controls</h3> <p>❎ select/de-select piece and move-to square<br /> 🅾️ hold down during white's move to show a hint</p> https://www.lexaloffle.com/bbs/?tid=142371 https://www.lexaloffle.com/bbs/?tid=142371 Tue, 21 May 2024 02:25:47 UTC table behaviour in lua/pico <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>a = {x=10, y=25} b = a b.x = 99 print(a.x)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>This prints <code>99</code> but I assumed it would print <code>10</code>.<br /> I wrote code with a start table. Then I set a position table equal to the start table. I was hoping to update the position table but reset the position back to the start point at any time I wanted. I tested this out in php to make sure I wasn't crazy and it worked like I expected. I tried it out in strict Lua but it gave the result above. Why does Lua change the <code>a</code> table when I only changed the <code>b</code>? How do I deal with this?</p> https://www.lexaloffle.com/bbs/?tid=142102 https://www.lexaloffle.com/bbs/?tid=142102 Fri, 03 May 2024 23:49:34 UTC export sprite sheet <p>In pico-8, when I want to reuse a sprite sheet for a new cart, I would just<br /> copy/paste all the gfx and map data at the end of the file. It's not so simple<br /> in Picotron.</p> <p>How do I start a new cart in Picotron with an existing sprite sheet and map?</p> https://www.lexaloffle.com/bbs/?tid=142016 https://www.lexaloffle.com/bbs/?tid=142016 Mon, 29 Apr 2024 02:42:49 UTC Mate in 2 -- Volume 2 <p>Mate-in-2 Volume 2. 33 more puzzles. White to move. <table><tr><td> <a href="/bbs/?pid=147158#p"> <img src="/bbs/thumbs/pico8_matein2vol2-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=147158#p"> matein2vol2</a><br><br> by <a href="/bbs/?uid=92361"> camp39</a> <br><br><br> <a href="/bbs/?pid=147158#p"> [Click to Play]</a> </td></tr></table> </p> https://www.lexaloffle.com/bbs/?tid=141898 https://www.lexaloffle.com/bbs/?tid=141898 Mon, 22 Apr 2024 23:58:04 UTC Mate In 2 -- Vol.1 <p> <table><tr><td> <a href="/bbs/?pid=144867#p"> <img src="/bbs/thumbs/pico8_matein2volume1-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=144867#p"> matein2volume1</a><br><br> by <a href="/bbs/?uid=92361"> camp39</a> <br><br><br> <a href="/bbs/?pid=144867#p"> [Click to Play]</a> </td></tr></table> </p> <p>33 mate-in-2 puzzles. White to move. Will release more volumes.</p> https://www.lexaloffle.com/bbs/?tid=141199 https://www.lexaloffle.com/bbs/?tid=141199 Thu, 28 Mar 2024 16:50:37 UTC