Search found 51 matches

by gcmartijn
Sun Nov 29, 2020 6:30 pm
Forum: Support and Development
Topic: astar to slow to work with... doing it wrong I guess
Replies: 5
Views: 2414

astar to slow to work with... doing it wrong I guess

Hi, After several weekends I give up, and need some advice for next weekend. I want that a player can walk around a rectangle if he is clicking above/below/right/left so the player would walk around it automaticly (if needed). I have several functions like willCollide(x,y) The world only have rectan...
by gcmartijn
Sun Nov 22, 2020 12:55 pm
Forum: Support and Development
Topic: How to know if a object is [top|bottom|left|right] using another object?
Replies: 5
Views: 2703

Re: How to know if a object is [top|bottom|left|right] using another object?

Thanks, I see now that this is not a ideal situation for a problem I try to solve. I will try to avoid this and re-thing about another solution. Maybe at some point I need to have the same function like https://2dengine.com/?p=intersections#Point_inside_rectangle so a point can have with multiple ou...
by gcmartijn
Sun Nov 22, 2020 11:29 am
Forum: Support and Development
Topic: How to know if a object is [top|bottom|left|right] using another object?
Replies: 5
Views: 2703

Re: How to know if a object is [top|bottom|left|right] using another object?

Good point, need to explain it better. BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB A output: left side BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB A output: left side You can say this maybe: draw virtual 2 horizontal lines and 2 vertical lines around the rect. And then check on which side the x,y point is. --|-----...
by gcmartijn
Sun Nov 22, 2020 9:56 am
Forum: Support and Development
Topic: How to know if a object is [top|bottom|left|right] using another object?
Replies: 5
Views: 2703

How to know if a object is [top|bottom|left|right] using another object?

H! I thought it was easy, and I guess I will figure it out but maybe someone already made this? function something(x,y, x1,y1, x2, y2) -- here I can simply check that x > then x1 and x2 -- here I can simply check that x < then x1 and x2 -- here I can simply check that y > then y1 and y2 -- here I ca...
by gcmartijn
Thu Oct 22, 2020 5:13 pm
Forum: General
Topic: Love CPU usage
Replies: 41
Views: 36616

Re: Love CPU usage

----------------------------------- -- n images | CPU | MEM | FPS | vsync ----------------------------------- -- 1000 | 60% | 72 MB | 60 | 1 -- pairs -- 1000 | 35% | 72 MB | 60 | 1 -- ipairs It make a huge difference indeed, but with 5000 items (what nobody uses) no difference. Interesting thing to ...
by gcmartijn
Thu Oct 22, 2020 2:04 pm
Forum: General
Topic: Love CPU usage
Replies: 41
Views: 36616

Re: Love CPU usage

lol, it is not my intention to do this in the actual game (I do use atlas images). But I want to know what is possible in love using my system, and I don't know if there is still a cpu high usage problem. For example, I use classes and want to know how many Objects I can create that hold some data. ...
by gcmartijn
Thu Oct 22, 2020 1:13 pm
Forum: General
Topic: Love CPU usage
Replies: 41
Views: 36616

Re: Love CPU usage

Today I was testing how many images my test system can handle, so I know how many images and other things I can use. A very simple test for now was loading and drawing images. And I do see a CPU 90% using around 5000 small images, and don't know if that is normal. 1. I don't know if this is a Apple ...
by gcmartijn
Sat Oct 17, 2020 2:23 pm
Forum: General
Topic: PointInConcavePolygon at this website is not correct, it gives a incorrect true
Replies: 3
Views: 3479

Re: PointInConcavePolygon at this website is not correct, it gives a incorrect true

Ow I did know that, thanks for the information.
I will unittest only the inside points and not the 'border'.
by gcmartijn
Sat Oct 17, 2020 12:22 pm
Forum: General
Topic: PointInConcavePolygon at this website is not correct, it gives a incorrect true
Replies: 3
Views: 3479

PointInConcavePolygon at this website is not correct, it gives a incorrect true

Hi, I'm write a unittest and using this function to detect if a point is inside a polygon. https://love2d.org/wiki/PointInConcavePolygon poly = { 0, 0, 10, 0, 10, 10, 0, 10 } pointInPolygon(poly, 10, 10) -- returns false , correct pointInPolygon(poly, 10, 0) -- returns false , correct pointInPolygon...
by gcmartijn
Sun Sep 27, 2020 12:32 pm
Forum: General
Topic: Generate a vector outline from an image?
Replies: 8
Views: 5496

Re: Generate a vector outline from an image?

I know this is a old topic, but it is I guess the correct place to ask this question. I don't want a concave hull but the exact simplified outline (contour) from a transparent png file. After many road's taken, I did post my full question here: https://stackoverflow.com/questions/64085745/get-the-co...