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

2015/6/18

Get more than ONE object at OFFSET?? (:

JohnVarick JohnVarick

2015/6/18

#
Hello! Is it in any way possible for the below code to have more than ONE object? For example: When my player eats the Star, another object would also be eaten (removed). Is this even possible? And if it is thank you!
Actor Star;
        Star = getOneObjectAtOffset(0, 0, Star.class);
        if (Star !=null)
        {
            World world;
            world = getWorld();
            Win win = new Win();
            world.removeObject(Star);
        }
danpost danpost

2015/6/18

#
Vague. Is the "another object" also a Star object or of a different type? (from the title, I would presume the "another object" be of the same type). If the same type, then use 'getObjectsAtOffset'. If not, use something similar to how the Border was removed when the Heart2 was eaten (from your previous discussion thread).
You need to login to post a reply.