Hey i really need some help and fast!
Sorry for the rush but i have an exam tommorow where i need to know this.
So this is the problem I want to end my game and switch to the EndWorld if lives are 0
this is my code:
please please help me out!!
public void checkPlayer() { setLocation (getX(), getY() +2); if(isTouching(Player.class)) { GameWorld myWorld = (GameWorld) getWorld(); myWorld.getLifeCounter().add(-1); myWorld.removeObject(this); } else if (getY()> getWorld().getHeight()-5){ getWorld().removeObject(this); } }