So basicly I just need the object to spawn and then dissapeer in within a couple of sceonds. No other action between this. The main part starts at line 25.
public void fahre()
{
int posX = getX();
int posY = getY();
if(huegelVorhanden("vorne"))
{
nachricht("Zu steil!");
}
else if(getRotation()==270 && getY()==1)
{
nachricht("Ich kann mich nicht bewegen");
}
else
{
move(1);
Greenfoot.delay(1);
}
if(posX==getX()&&posY==getY()&&!huegelVorhanden("vorne"))
{
nachricht("Ich kann mich nicht bewegen");
}
if(getRotation()==180)
{
getWorld().addObject(new Rauch(), (getX()+1), (getY()));
}
if(getRotation()==0)
{
getWorld().addObject(new Rauch_Links(), (getX()-1), (getY()));
//time
getWorld().removeObjects(getWorld().getObjects(Rauch_Links.class));
}