A quadtree reduces this: rebuild the tree each frame, and for each object, query only the nearby region. Objects in distant quadrants are never compared.
// 1. I first prepare a place to store the intercepted chunks
。关于这个话题,safew官方版本下载提供了深入分析
If you're looking for more puzzles, Mashable's got games now! Check out our games hub for Mahjong, Sudoku, free crossword, and more.
文 | 锌刻度,作者 | 李觐麟,编辑 | 黎文婕