So i'm trying to update my score when an enemy dies in a game but it keeps me giving the error message in de code above. Can someone help me out?
Here's the code in my world class:
And this is the code in my enemy class:
Thanks!
1 2 3 4 5 | public void updateScore( int amount) { score = score + amount; showText( "Score: " + score, 100 , 50 ); } |
1 2 3 4 5 6 7 8 9 | private void checkAlive() { if (isAlive= false ) { MyWorld theWorld = (MyWorld) getWorld(); MyWorld.updateScore( 15 ); } } |