simonwilson [Lexaloffle Blog Feed] Move object to target smoothly <p>I need some help with the math for making an object move between 2 fixed positions, then slow down smoothly to the final position.</p> <p>The cart contains my attempt to make this work but I cannot quite reach the end point, and therefore the mode variable does not change.</p> <p>Can anyone see what is missing here, and what could I do to make the last few steps a bit faster? (It slows to a crawl at the end...!)</p> <p>Many thanks in advance :)</p> <img style="margin-bottom:16px" border=0 src="/media/51436/smooth_move_to_fixed_pos_1.gif" alt="" /> <p> <table><tr><td> <a href="/bbs/?pid=115949#p"> <img src="/bbs/thumbs/pico8_demenifji-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=115949#p"> demenifji</a><br><br> by <a href="/bbs/?uid=51436"> simonwilson</a> <br><br><br> <a href="/bbs/?pid=115949#p"> [Click to Play]</a> </td></tr></table> </p> Wed, 17 Aug 2022 19:02:54 UTC Player sprite with rotation and forward movement <p>Hello :)</p> <p>(Forever) Beginner level programmer here!</p> <p>I have been trying to make a top down driving game, and rather than reinvent the wheel I figured I could take some existing carts and use the code to make a player that uses a sprite that can rotate, and move forward and backward.</p> <p>I found this post for the sprite rotation, which works exactly as I would like, although I can't really grasp how the function is working: <a href=""></a> (example1)</p> <p>Then I found a cart of Asteroids by <a href=""> @mccolgst</a>: <a href=""></a>, stripped out all the stuff I didn't need (example2), and have been going between these 2 carts to try and combine the sprite rotation function with the desired movement.</p> <p>Unfortunately I hit a wall and my latest effort was example3, but I'm quite lost honestly.</p> <p>Can anyone shed some light on how these carts work and how I could go about applying a forward movement to a rotated sprite?</p> <p>Many thanks in advance!</p> <p> <table><tr><td> <a href="/bbs/?pid=105335#p"> <img src="/bbs/thumbs/pico8_example1-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=105335#p"> example1</a><br><br> by <a href="/bbs/?uid=51436"> simonwilson</a> <br><br><br> <a href="/bbs/?pid=105335#p"> [Click to Play]</a> </td></tr></table> <br /> <table><tr><td> <a href="/bbs/?pid=105335#p"> <img src="/bbs/thumbs/pico8_example2-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=105335#p"> example2</a><br><br> by <a href="/bbs/?uid=51436"> simonwilson</a> <br><br><br> <a href="/bbs/?pid=105335#p"> [Click to Play]</a> </td></tr></table> <br /> <table><tr><td> <a href="/bbs/?pid=105335#p"> <img src="/bbs/thumbs/pico8_example3-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=105335#p"> example3</a><br><br> by <a href="/bbs/?uid=51436"> simonwilson</a> <br><br><br> <a href="/bbs/?pid=105335#p"> [Click to Play]</a> </td></tr></table> </p> Tue, 18 Jan 2022 18:25:02 UTC Change animation sequence on button input <p> <table><tr><td> <a href="/bbs/?pid=97078#p"> <img src="/bbs/thumbs/pico8_animmario-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=97078#p"> animmario</a><br><br> by <a href="/bbs/?uid=51436"> simonwilson</a> <br><br><br> <a href="/bbs/?pid=97078#p"> [Click to Play]</a> </td></tr></table> <br /> Hello! </p> <p>I am going a bit mad trying to figure out how to make a simple 4 frame sprite animation run on a loop, and then transition to a different 4 frame animation loop after a button is pressed.</p> <p>Simply - I am trying to make this Mario sprite look like it is walking forward when idle, or pressing forward, and then look like he is walking sideways when pressing left or right. I can make him animate on loop when idle, but I cannot figure out how to make it animate as a different sequence after a direction is pressed, and ensure the animation runs smooth (for example, I can get it to change to the new sequence, but holding the button down keeps the sequence locked into the first frame of the animation).</p> <p>I hope that makes sense! Does anyone have a simple solution?</p> Wed, 08 Sep 2021 21:39:59 UTC Smooth circular movement from player inputs <p>Hello!</p> <p>I am developing a small hockey type game where the player character can move in all directions. It works fine enough but because of the D-pad movement, if the player tries to go in a circle, its very much a diamond shaped movement instead.</p> <p>I am not sure if there is any way to make this movement smoother, so its circular if you hit the buttons in quick succession like the below gif image?</p> <p>Any suggestions or feedback are most welcome! :) Thanks!</p> <p> <table><tr><td> <a href="/bbs/?pid=95130#p"> <img src="/bbs/thumbs/pico8_testinghockey-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=95130#p"> testinghockey</a><br><br> by <a href="/bbs/?uid=51436"> simonwilson</a> <br><br><br> <a href="/bbs/?pid=95130#p"> [Click to Play]</a> </td></tr></table> </p> <img style="margin-bottom:16px" border=0 src="/media/51436/ninja_1.gif" alt="" /> Wed, 21 Jul 2021 15:44:31 UTC U.F.OhNo! <p> <table><tr><td> <a href="/bbs/?pid=87584#p"> <img src="/bbs/thumbs/pico8_ufoshooter-2.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=87584#p"> UFOhNo</a><br><br> by <a href="/bbs/?uid=51436"> simonwilson</a> <br><br><br> <a href="/bbs/?pid=87584#p"> [Click to Play]</a> </td></tr></table> </p> Sat, 13 Feb 2021 11:03:22 UTC