2022 Developer Survey is open! Take survey.

New answers tagged

2 votes

Determine if a triangle is on the screen

There are three kinds of positional relationship between two plane figures: disjoint, one inside the other, partial intersection. You need to check for partial intersection and one inside the other. ...
user avatar
  • 651
2 votes
Accepted

Find closest open space in grid of rectangles?

I did some tests and found that this method does work. First you need to find the nearest grid coordinates to the position of the dragged block (blue box). Then do a grid-based BFS on the target ...
user avatar
  • 651
0 votes

Detect if a chain of tiles form an enclosed shape/contour

Once the player steps on a new tile and colours it, examine the neighbourhood (8 tiles around it). Find the tiles that are of the player's colour, sort out early rejections (if there are 2 or fewer, ...
user avatar

Top 50 recent answers are included