This site requires JavaScript, please enable it in your browser!
Greenfoot back
CavemanWrath
CavemanWrath wrote ...

2017/12/2

Proximity Detecting

CavemanWrath CavemanWrath

2017/12/2

#
I am trying to create a minesweeper style program, but I can not figure out how to detect nearby mines/empty spaces. The squares are not touching, therefore I cannot do an isTouching or an intersectingObject method, so the way I'd prefer to do this is to detect all objects within the proximity of the clicked box. How would I go about doing this?
danpost danpost

2017/12/2

#
The two methods that you can consider are 'getNeighbors' and 'getObjectsInRange'.
CavemanWrath CavemanWrath

2017/12/2

#
How exactly would I use those? What parameters are required?
danpost danpost

2017/12/2

#
CavemanWrath wrote...
How exactly would I use those? What parameters are required?
Make use of the API documentation.
You need to login to post a reply.