Hello! I made different types of trucks. In the constructor parameters are booleans which determine which color it is. This all works fine, when the truck spawns in the desired color it does so. But when i want to access those booleans in the run state (for interaction reasons), it says every boolean is false. Is there any way to fix this?
public boolean isBlue; public boolean isRed; public boolean isGrey; public boolean isYellow; GreenfootImage selectImage; public Truck (boolean isBlue, boolean isRed, boolean isGrey, boolean isYellow) { if (isBlue == true) { selectImage = new GreenfootImage("bluetruck.png"); setImage(selectImage); } else if (isRed == true) { selectImage = new GreenfootImage("redtruck.png"); setImage(selectImage); } else if (isGrey == true) { selectImage = new GreenfootImage("greytruck.png"); setImage(selectImage); } else if (isYellow == true) { selectImage = new GreenfootImage("yellowtruck.png"); setImage(selectImage); } }