kaneda23 [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=74311 Stuttering with simple movement test <p>I'm new to PICO-8, and my first experiment was to create a simple program that moves a rectangle back and forth. When I run it, the movement will be fairly smooth at first, but then I start to notice a sort of hitching every couple of seconds. I tried this both on my desktop and laptop, and see the same behavior on both computers.</p> <p>Is this something with my code, my eyes, or PICO-8 itself?</p> <p>I'm running this on Windows by the way.</p> <p>Here is the code I'm trying:</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>x = 109 xs = -1 function _update() x = x + xs if x &lt; 0 or x &gt; 110 then xs = xs * -1 end end function _draw() cls() rectfill(x,0,x+15,30,12) end</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=51447 https://www.lexaloffle.com/bbs/?tid=51447 Wed, 01 Feb 2023 23:43:18 UTC