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

2019/1/12

Get object at location

Randomness Randomness

2019/1/12

#
Hey! Is there a way to get an object at a location? So the object ist at 400,400 and if I check the position 400,400 it'll return the object?
danpost danpost

2019/1/12

#
Provided the actor is actually there:
1
Actor actor = (Actor)getObjectsAt(400, 400, Actor.class).get(0);
You can give more specifically what type of object to look for by replacing "Actor.class" with some subclass of the Actor class.
You need to login to post a reply.