Best 2D map collisions?

I want to make a game like Limbo. I started make a not tiled map and i decided to draw Map and Mask of Map. And now i don’t know how to detect “corners” in Mask. case i don’t want detect collisions by pixels…I have an idea to make an array of Triangles and detect collisions between player and Triangles array…Also a have an idea to make a Map Maker which will save all information about corners and other in text file.
If you know better way to realise my idea just say :slight_smile: thanks.

There is Java.Awt.Polygon. But it doesn’t have some basic things like being able to get the angle of the slope you’re on and similar.

There’s also an improvement floating around on this forum of the Polygon class that has some nice speed improvements.

You could also roll your own. If you draw any polygon and draw a line through it, it will cross an odd number of the polygon’s edges if it’s inside it (one of the endpoints of the line) or an even number if it’s outside of it.