i need help changing the background of the game when the score reaches a certain amount.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | public class Rocket extends Actor { int score = 0 ; /** * Act - do whatever the Rocket wants to do. This method is called whenever * the 'Act' or 'Run' button gets pressed in the environment. */ public void act() { setLocation(getX(),getY()- 20 ); addScore(); checktop(); if (score == 5 ) { getWorld().setBackground( new GreenfootImage( "brick.jpg" )); } } |