Firebird [Lexaloffle Blog Feed] [solved] Need Help With Weird Collision Glitches <p> <table><tr><td> <a href="/bbs/?pid=66686#p"> <img src="/bbs/thumbs/pico8_gamuretihi-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=66686#p"> Pico Invaders - WIP</a><br><br> by <a href="/bbs/?uid=33558"> Firebird</a> <br><br><br> <a href="/bbs/?pid=66686#p"> [Click to Play]</a> </td></tr></table> </p> <p>I decided to make a space invaders clone in pico-8 over the weekend. I've been having a bit of trouble with a weird collision glitch that only happens when my Alien entities react to colliding with the right side of the screen. I've Worked through the logic in my head and my code should work. I've tried numerous variations of what I currently have in my cart thinking that maybe there is something with the code execution that is causing it to be off. </p> <p>I'm pretty sure that the problem is related to the bit of code below. However, I'm not 100% sure since I haven't been able to fix it yet :-)</p> <div> <div style="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>update = function(self) if(self.x &lt;= 0) then adr = 1 self.x = 0 elseif(self.x &gt;= 120) then adr = -1 self.x = 120 end self.x +=self.v*adr 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>Please direct me towards a solution if you can. This type of collision detection is usually pretty straightforward to do, but I've spent more time trying to fix this bug than I've spent making everything else.</p> <p>[Edit]<br /> I was able to fix the problem by moving the collision detection into a different loop to separate it from the position update so that the direction wouldn't be changed before all the entities had finished updating.</p> <p> <table><tr><td> <a href="/bbs/?pid=66686#p"> <img src="/bbs/thumbs/pico8_zitomarufe-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=66686#p"> Fixed Collision Detection</a><br><br> by <a href="/bbs/?uid=33558"> Firebird</a> <br><br><br> <a href="/bbs/?pid=66686#p"> [Click to Play]</a> </td></tr></table> </p> Fri, 16 Aug 2019 00:51:34 UTC Python Fantasy Console <p>Have any of you used the Pyxel fantasy console? I just found out about it this week and I think it could possibly be made to work on the adafruit pybadge. It was designed to be a python substitute for Pico-8 and the creator cites pico-8 as his main inspiration for making it. It&rsquo;s open source and could probably be made to run on the adafruit pybadge. There are a few developers working on a pybadge port of Celeste/pico-8 carts, but I haven&rsquo;t found any more information about that project except for a few social media pictures and a GitHub repo. If the Pico-8 port to pybadge never happens then pyxel could be a possible substitute.</p> <p>Here is the link to the Pyxel fantasy console: <a href=""></a></p> <p>Pico-8 is always my first choice for a fantasy console, but if it won&rsquo;t be available on the pybadge then pyxel may be an acceptable substitute.</p> Sat, 25 May 2019 03:33:09 UTC Points Within A Square Domain <p> <table><tr><td> <a href="/bbs/?pid=64361#p"> <img src="/bbs/thumbs/pico8_zohasaberi-8.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=64361#p"> Points Within A Square Domain</a><br><br> by <a href="/bbs/?uid=33558"> Firebird</a> <br><br><br> <a href="/bbs/?pid=64361#p"> [Click to Play]</a> </td></tr></table> <br /> I figured out how to use distance formulas to determine if a point lies within a non-orthogonal rectangular region. I can see many possible applications of this and thought I would share my solution. I'm sure there is a more efficient way to do this, but this is the best solution I could come up with at the time that didn't involve vector math. I tried to comment my code to help people understand it better, but I didn't go into great detail with explaining the math. Anyway, It only took me about an hour to come up with this demo but I hope someone can find it useful.</p> Mon, 13 May 2019 07:50:15 UTC R&ouml;ssler Attractor3D <p> <table><tr><td> <a href="/bbs/?pid=62677#p"> <img src="/bbs/thumbs/pico8_nazubukiho-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=62677#p"> R&ouml;ssler Attractor3d</a><br><br> by <a href="/bbs/?uid=33558"> Firebird</a> <br><br><br> <a href="/bbs/?pid=62677#p"> [Click to Play]</a> </td></tr></table> </p> <p>I wanted to do something new and interesting. After searching around the BBS, I found that nobody had published any strange attractors(I love strange attractors) so I decided I would be the first. I created a Lorenz attractor visualizer in java a few months ago so I decided to port it to pico-8. Then this week just as I started working on my Lorenz attractor I saw <a href="">this</a>. I can't believe It. Anyway, since Mattias beat me to a Lorenz, I will make a R&ouml;ssler attractor. </p> <p>I'm still pretty new to pseudo 3D, pico-8, and Lua in general so I will use the 3D plotting engine Mattias made until I can finish porting mine :P </p> <p>Important Notice:<br /> This spinoff will officially reserve the position of first R&ouml;ssler attractor made/published in pico-8 :)<br /> It will eventually be replaced with my own engine.</p> <p>Do any of you know of any good resources I can use to learn about 2D to 3D projections and other pseudo-3D related stuff? I rarely do anything with 3D and the little I have done used 3D engines like OpenGL.</p> Fri, 08 Mar 2019 06:46:23 UTC