So in my Scenario there are Sensors that change their Image to "Sensor On.png" if they are touching a Block. Now if all Sensors are activated(all Images of the Sensors are "Sensor On.png)) I want to add a Goal.
I think this needs to happen in my Scene.
Code of the Sensor:
import greenfoot.*;
public class Sensor extends Actor
{
public void act()
{
if (isTouching(Block.class) == true)
{
setImage("Sensor On.png");
}
if (isTouching(Block.class) == false)
{
setImage("Sensor Off.png");
}
}
public boolean touchingB()
{
return isTouching(Block.class);
}
}
