This site requires JavaScript, please enable it in your browser!
Greenfoot back
Sauravbasyalking12
Sauravbasyalking12 wrote ...

2020/8/26

Hi I am stuck in this scenario

Sauravbasyalking12 Sauravbasyalking12

2020/8/26

#
I have alredy made the game but I don't know what code should be used after instead of the game ending when the player is hit by the enemy or the timer runs out (you can comment out this code), that the enemy is removed, and 25points is taken away from the score
danpost danpost

2020/8/26

#
Sauravbasyalking12 wrote...
I have alredy made the game but I don't know what code should be used after instead of the game ending when the player is hit by the enemy or the timer runs out (you can comment out this code), that the enemy is removed, and 25points is taken away from the score
Use an act method in your World subclass and ask if (any) enemy is in the world.
Sauravbasyalking12 Sauravbasyalking12

2020/8/30

#
I need to change the code instead of greenfoot.stop in instead of game ending if ( isTouching(Crab.class) ) { removeTouching(Crab.class); Greenfoot.playSound("au.wav"); Greenfoot.stop(); }
danpost danpost

2020/8/31

#
Sauravbasyalking12 wrote...
I need to change the code instead of greenfoot.stop in instead of game ending << Code Omitted >>
Drop it and ask if any crabs are left in the world.
You need to login to post a reply.