VillianousJoker [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=78643 Problems with Finding Collision! <p>Hi! So I'm very new to Pico-8 and recently purchased Pico-8 to test my skills in coding and currently I'm having problems trying to find collision. My Current Code is shown below:</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 update_game() if fget(2,0) then --wall else if btnp(⬅️) then p_x-=1 end if btnp(➡️) then p_x+=1 end if btnp(⬆️) then p_y-=1 end if btnp(⬇️) then p_y+=1 end 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>To describe my problem, I currently can go through any wall I want to, and it still moves.</p> https://www.lexaloffle.com/bbs/?tid=53324 https://www.lexaloffle.com/bbs/?tid=53324 Tue, 04 Jul 2023 18:49:51 UTC