Good catch there pgimeno! The correct way is to add the radius of the circle to each side of the square, and that will reduce the problem to point vs square which is trivial. Then you can compare the distance from the center point of the circle to the edges of the expanded square against the circle'...
I think your example code is fine. Just check the distance from the turret to the center of the enemy, there is no need to involve squares/rectangles. If you insist then here is the code: https://2dengine.com/?p=intersections#Circle_vs_rectangle To determine if the square is *entirely* inside the ci...
The whole point of superstrict is that it doesn't allow assigning globals. You don't want to be assigning and changing globals from everywhere because it makes the code hard to follow and debug. If this is not your code and you don't want to check it, just add the following line at the top of the pr...
as instructed and nothing happened. AFTER you require superstrict it will intercept and check every following call to: require/dofile/loadfile/loadstring That's why you have to include superstrict at the beginning of your code, before including any other files. Don't forget to turn it off in produc...
Yes, I am using stravant's library with several modifications:
- vararg issue fixed
- no renaming for globals
- ffi hex numbers ending in ULL
- several other small improvements