AwesomeTurtle70 [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=63935 map collision only works in one direction <p>im tryin to make a platformer base to use for future projects, but when travelling in positive directions, the collision is seemingly not detected until a full pixel further than it should be</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> local xd=n.x+n.speed.x+n.w/2*sgn(n.speed.x) local yd=n.y+n.speed.y+n.h/2*sgn(n.speed.y) n.grounded=false n.walled=false if fget(mget(xd\8,(n.y+n.h/2)\8))==1 or fget(mget(xd\8,(n.y-n.h/2)\8))==1 then n.x=xd\8*8+(n.speed.x&gt;0 and -1-n.w/2 or 8+n.w/2) n.walled=true n.speed.x=0 end if fget(mget((n.x+n.w\2)\8,yd\8))==1 or fget(mget((n.x-n.w\2)\8,yd\8))==1 then n.y=yd\8*8+(n.speed.y&gt;0 and -1-n.h/2 or 8+n.h/2) n.grounded=true n.speed.y=0 end n.x+=n.speed.x n.y+=n.speed.y</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>negative velocity position readings(continuously accelerating by -0.005 pixels/second/second)<br /> INFO: y=10<br /> INFO: y=10<br /> INFO: y=10<br /> INFO: y=10<br /> INFO: y=10<br /> positive velocity position readings(continuously accelerating by 0.005 pixels/second/second)<br /> INFO: y=29.7242<br /> INFO: y=29.8109<br /> INFO: y=29.9025<br /> INFO: y=29.999<br /> INFO: y=29</p> <p>negative velocity position readings(given a constant velocity of -0.005 pixels/second while pressed against wall)<br /> INFO: y=10<br /> INFO: y=10<br /> INFO: y=10<br /> INFO: y=10<br /> INFO: y=10<br /> positive velocity position readings(given a constant velocity of 0.005 pixels/second while pressed against wall)<br /> INFO: y=29.9844<br /> INFO: y=29.9883<br /> INFO: y=29.9922<br /> INFO: y=29.9961<br /> INFO: y=29</p> <p>this happens at any speed/width/height combination, and the readings are from the last 5 frames before a collision is registered<br /> i have a feeling this is because of flooring but i dont know how i would fix it :3</p> https://www.lexaloffle.com/bbs/?tid=54356 https://www.lexaloffle.com/bbs/?tid=54356 Fri, 29 Sep 2023 17:15:57 UTC shazia in real life <p> <table><tr><td> <a href="/bbs/?pid=130378#p"> <img src="/bbs/thumbs/pico8_shaiza-2.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=130378#p"> shaiza</a><br><br> by <a href="/bbs/?uid=63935"> AwesomeTurtle70</a> <br><br><br> <a href="/bbs/?pid=130378#p"> [Click to Play]</a> </td></tr></table> </p> <p>lil demake of shazia from counterpact :3</p> <p>controls:<br /> AD: move<br /> S: slide<br /> left click: melee (reveals you for now)<br /> right click: throw chain<br /> F: sit</p> <p>old versions:<br /> <div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;"> <table><tr><td> <a href="/bbs/?pid=130378#p"> <img src="/bbs/thumbs/pico8_shaiza-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=130378#p"> shaiza</a><br><br> by <a href="/bbs/?uid=63935"> AwesomeTurtle70</a> <br><br><br> <a href="/bbs/?pid=130378#p"> [Click to Play]</a> </td></tr></table> </div></div></div><br /> <div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;"> <table><tr><td> <a href="/bbs/?pid=130378#p"> <img src="/bbs/thumbs/pico8_shaiza-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=130378#p"> shaiza</a><br><br> by <a href="/bbs/?uid=63935"> AwesomeTurtle70</a> <br><br><br> <a href="/bbs/?pid=130378#p"> [Click to Play]</a> </td></tr></table> </div></div></div></p> https://www.lexaloffle.com/bbs/?tid=52943 https://www.lexaloffle.com/bbs/?tid=52943 Wed, 31 May 2023 22:31:57 UTC