Mikimation [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=60979 Check if player inside sector of circle (Radial line of sight) <p>I'm trying to make a radial sight function for the enemies in my game</p> <p>I want them to know if the player has entered a radius around them, and be able to control the angle of their sight according to their direction<br /> So basically it's checking if the player has entered a sector of the radius around them, and also being able to control the percentage of the sector and its direction.</p> <p>I thought about splitting the radius around them into directions, as seen in the image. I'm not sure if that's right.</p> <img style="" border=0 src="/media/60979/2_radial sight copy.jpg" alt="" /> <p>I'm terrible at math so I couldn't figure this one out, I'd appreciate the help</p> <p>this is the closest solution that I found, but I couldn't make it work<br /> <a href="https://www.geeksforgeeks.org/check-whether-point-exists-circle-sector-not/">https://www.geeksforgeeks.org/check-whether-point-exists-circle-sector-not/</a></p> https://www.lexaloffle.com/bbs/?tid=46972 https://www.lexaloffle.com/bbs/?tid=46972 Mon, 14 Mar 2022 10:34:43 UTC Help with tentacle <p>I'm trying to make a tentacle using sin().<br /> I want the base (the top circle) to be static, and the wiggle of the tentacle to get stronger until it reaches the tip (the bottom circle).<br /> So far I have only achieved a pendulum<br /> I'm not that good with math so I'm not sure about how to do it<br /> here's my code</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>function _init() length=20 x=64 y=40 end function _draw() cls() for i=0,length do circfill(x+sin(time())*i,y+i*4,length-i,14) 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> https://www.lexaloffle.com/bbs/?tid=45855 https://www.lexaloffle.com/bbs/?tid=45855 Sat, 25 Dec 2021 10:11:23 UTC How to check if there are no flags? <p>I'm working on a platformer game. I'm having an issue with enemy AI.<br /> I want that the enemy will turn the opposite way once it reaches a cliff, much like a collision with a wall.<br /> I want to make a collision check that will check if the floor of the tile after the enemy doesn't have any flags.<br /> How do I do that if 0 means the first flag?</p> https://www.lexaloffle.com/bbs/?tid=45774 https://www.lexaloffle.com/bbs/?tid=45774 Mon, 20 Dec 2021 17:10:19 UTC