Log In  
Follow
Mikimation
Follow

I'm trying to make a radial sight function for the enemies in my game

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
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.

I thought about splitting the radius around them into directions, as seen in the image. I'm not sure if that's right.

I'm terrible at math so I couldn't figure this one out, I'd appreciate the help

this is the closest solution that I found, but I couldn't make it work
https://www.geeksforgeeks.org/check-whether-point-exists-circle-sector-not/

P#108590 2022-03-14 10:34 ( Edited 2022-03-14 10:37)

I'm trying to make a tentacle using sin().
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).
So far I have only achieved a pendulum
I'm not that good with math so I'm not sure about how to do it
here's my code

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
P#103517 2021-12-25 10:11

I'm working on a platformer game. I'm having an issue with enemy AI.
I want that the enemy will turn the opposite way once it reaches a cliff, much like a collision with a wall.
I want to make a collision check that will check if the floor of the tile after the enemy doesn't have any flags.
How do I do that if 0 means the first flag?

P#103187 2021-12-20 17:10 ( Edited 2021-12-20 17:10)

Follow Lexaloffle:        
Generated 2022-07-04 09:30:07 | 0.048s | Q:7