Hello Everyone (PLZ HELP)
my rocket is shooting a Bullet (ObjectA) " ProjektilGelb" and if this hits the Object B i would want that the Bullet (object A) disappears
which methode should i Use
and should I programm it in the Bullet or in the Object B
here is the code from the bullet
i think i should put the methode in this class right ?
public class ProjektilGelb extends Actor
{
/**
* Act - do whatever the ProjektilGelb wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()//ProjektilGelb tut was auch immer in der "act" Methode drin steht
{
moveEast();//bewegt sich nach Osten (rechts)
if (atWorldEdge())
{
getWorld().removeObject(this);
}
}
public boolean atWorldEdge()
{
if(getX() == 100)
return true;
else
return false;
}
public void moveEast()//bewegung von ProjektilGelb wird deffiniert
{
setLocation(getX()+1,getY());
}
}
