New answers tagged algorithm
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.
...
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 ...
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, ...
Top 50 recent answers are included
Related Tags
algorithm × 1116path-finding × 136
mathematics × 127
2d × 87
ai × 87
procedural-generation × 84
c# × 74
c++ × 69
unity × 67
java × 63
game-design × 58
collision-detection × 55
3d × 50
random × 49
geometry × 46
grid × 41
physics × 36
xna × 31
javascript × 31
maps × 31
game-mechanics × 28
tilemap × 26
tiles × 25
terrain × 25
data-structure × 25