What i want is the object Car.class too turn into the object StolenCar.class after i use the button "e" to steal it. Is this possible? This is what i have so far...
public class Autodief extends Speler{
private int count = 0;
private boolean foundcollison;
private int character = 0;
public void act(){
SpelerBesturing();
Stelen();
bestuurder();
}
public void Stelen(){
if (Greenfoot.isKeyDown("e") && character == 0 && bestuurder()){
character = 1;
getWorld().removeObject(this);
}
}
public boolean bestuurder(){
Actor StolenCar = getOneIntersectingObject(Burgerauto.class);
if(StolenCar != null){
return true;
} else {
return false;
}
}
public boolean foundcollison(){
Actor Politieauto_move = getOneObjectAtOffset(0, 0, Burgerauto.class);
if(Politieauto_move != null) {
return true;
} else {
return false;
}
}
}

