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

2013/5/6

Removing at world edge

Hawx_ Hawx_

2013/5/6

#
I've lost the code from my previous game so I can't get the code I'm looking for from that. I need to be able to delete the plasma at the worlds edge , this is what I have already: ( the code is in Plasma / Actor)
 if(getY()>10 ){
           getWorld().removeObject(this);
    }  ;
but it doesn't work . help please Hawx_
JetLennit JetLennit

2013/5/6

#
1. } ; should just be } 2. This removes it at the top, I'm not sure if that is what you want 3. It would be easier to do
if(getY()>10 ) getWorld().removeObject(this);  
danpost danpost

2013/5/6

#
I am not sure you want to restrict your plasma to the top edge of the screen like that. Maybe you meant:
if (getY()<10) ...
JetLennit JetLennit

2013/5/6

#
Hadn't caught that! Then again i make the same mistake
Hawx_ Hawx_

2013/5/6

#
thanks guys :D
You need to login to post a reply.