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

2017/6/9

Function Stopped

MayconRick MayconRick

2017/6/9

#
I have a game, and I want to make a condition that will stop it. A ship that shoots another that is in motion, I have five initial shots. When I miss the ship, I get shot. When I hit, I get a shot. The game ends when the shots hit zero, displaying a "game end you missed" message and your score.
danpost danpost

2017/6/9

#
MayconRick wrote...
The game ends when the shots hit zero, displaying a "game end you missed" message and your score.
Something like:
if (shotCount == 0)
{
    showGameOver();
    Greenfoot.stop();
}
where 'showGameOver' may or may not remove all Actor object from the world and then creates the message with the score on an image which is somehow displayed (either using an Actor object or using the World background image).
You need to login to post a reply.