Why does this not work?
Rocket rocket = new Rocket();
public Label()
{
GreenfootImage img =new GreenfootImage(100,50);
img.drawString("Shots: " +rocket.getShot(),2,20);
setImage(img);
}
public void act()
{
GreenfootImage img =new GreenfootImage(100,50);
img.drawString("Shots: " +rocket.getShot(),2,20);
setImage(img);
}
Shot is an attribute from the Rocket class, but I always get the same value here although it`s changing.