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

2019/8/4

getObjectsInRange does not work...

Proprogrammer04 Proprogrammer04

2019/8/4

#
Hi there, I had some problems with the getObjectsInRange-syntax:
    public void moveAI()
    {
        if(getObjectsInRange(100,player.class)!=null)
        {
            getWorld().showText("true",100,50);
        }
        else
        {
            getWorld().showText("true",100,50);
        }
    }
It sais Always true, even if the Player is About 900 cells away from the object… Why does that not work?
danpost danpost

2019/8/4

#
Proprogrammer04 wrote...
<< Code Omitted >> It sais Always true, even if the Player is About 900 cells away from the object…
It should be obvious as to why it always says "true".
You need to login to post a reply.