I have 2 worlds one set up for a daytime mode and one for night. I have made it so when the user loses the game the score moves under the gameover image and shows the user his score. This is how i did it But i try doing the same for DayTime world by replacing the HelicopterWorld to DayTime and it doesn't work the game runs in daytime mode and when i die this message appears java.lang.ClassCastException: DayTime cannot be cast to HelicopterWorld
at Helicopter.showGameOver(Helicopter.java:58)
at Helicopter.act(Helicopter.java:44)
how can i fix help!
private void showGameOver() {
HelicopterWorld world = (HelicopterWorld)getWorld();
world.addObject(new GameOver(), getWorld().getWidth()/2, getWorld().getHeight()/2);
world.scoreObj.setLocation(getWorld().getWidth()/2, getWorld().getHeight()/2+50);
}
