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

2022/2/3

Object does not get removed when at Edge.

NUKES NUKES

2022/2/3

#
This might just be a stupid mistake by me, but I cant for the love of god figure out why it does not work. In the following code, I made it so, if my "Bullet" object, touches either the Edge or the "Ball" class, it should get removed, but for some reason it just stays?
public void remove()
    {
        if (isAtEdge())
        {
           getWorld().removeObject(this); 
        }
        else if (isTouching(ball.class))
        {
            getWorld().removeObject(this);
        }
        remove();
Help is appreciated!
danpost danpost

2022/2/3

#
NUKES wrote...
This might just be a stupid mistake by me, but I cant for the love of god figure out why it does not work. In the following code, I made it so, if my "Bullet" object, touches either the Edge or the "Ball" class, it should get removed, but for some reason it just stays?
Is the remove method being called from anywhere? If so, from where? If not, then why not?
NUKES NUKES

2022/2/3

#
danpost wrote...
NUKES wrote...
This might just be a stupid mistake by me, but I cant for the love of god figure out why it does not work. In the following code, I made it so, if my "Bullet" object, touches either the Edge or the "Ball" class, it should get removed, but for some reason it just stays?
Is the remove method being called from anywhere? If so, from where? If not, then why not?
As I thought im just Stupid lol. I had to call the remove method. works now, thanks.
You need to login to post a reply.