I have tested it and it seems to be well performing, good job!Bigfoot71 wrote: ↑Sun Nov 20, 2022 9:58 pmHere is a small demo that I just made very quickly. The player himself is represented by a polygon and there is an adjustable number of enemies (also represented by polygons).
I use the isPolyInPoly function for collisions, which can be quite greedy, and no optimization has been done as mentioned by Ivan, at each frame all enemies will test their collision with the player.
I tried up to a hundred and something enemies and was running at 60 FPS on an Intel Pentium J2900.
I would like to specify that the more the number of vertices will be, the more the time required will be high too, demo only contains hexagons, therefore 6 vertices per shape.
Edit: Here is a video where I went up to more than 1000 polygons and I kept the 60 FPS rather well, I myself am pleasantly surprised ! https://streamable.com/6mm3ud
GeoMan - Geometry library
Re: GeoMan - Geometry library
My boat driving game demo: https://dusoft.itch.io/captain-bradley- ... itius-demo
Who is online
Users browsing this forum: No registered users and 4 guests