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

2016/6/8

How can i count objects in a radius ?

Rabe123 Rabe123

2016/6/8

#
Hi guys, i would try too count object that are in a radius from an object with the !getObjectsInRange(120, null).isEmpty() method. How can i make it ? Can i convert it to int ? thank you for help
danpost danpost

2016/6/8

#
The 'getObjectsInRange' method returns a list -- and a list has a size:
int countOfObjectsInRange = getObjectsInRange(120, null).size();
Rabe123 Rabe123

2016/6/8

#
ok thanks danpost :)
You need to login to post a reply.