Unit 3, Lesson 26, Bubble 20 - GAME OVER Problem

My student’s game has a scuba diver looking for treasure. In the game, the diver can increase his score as well as lose lives.

At the end of the game, a black screen appears with GAME OVER on it. The problem is that the score and the lives still show with GAME OVER.

The student wants GAME OVER to show when the game is over (duh)…BUT he doesn’t want the score or the lives to show.

Score & Lives are TEXT.

The background, scuba diver, coins, GAME OVER, etc. are all SPRITES.

Depending where you place the text in the Draw function, either the text shows all the time…or it is gone all the time.

I wondered if the following could happen:

1 - Make the background ocean scene NOT a sprite.
My student reminded me that the only backgrounds we have used are colors, not photos/drawings.

Is there a way to make it a background, not a sprite?

  1. At the end of the game when the screen with GAME OVER and Score/Lives appears, could we create a new sprite with just GAME OVER on it (no score/lives) and have it appear on top of/replace the initial GAME OVER screen?

  2. Or, with #2 above, could we have the GAME OVER slide appear as a background?

NOTE:

We tried to do 2 & 3 by putting the text inside the Draw function but before the Draw Sprites command. But the commands moving the sprites put them over the Score/Lives text, hiding them from view.

We tried to have two Draw routines: the first one covering 99% of the visible action, and then a second following the first - and the only role of the 2nd one was to draw the slide with only GAME OVER on it so that the game ended the way the student wanted it.

That didn’t work, so now we’re looking for ways to make it happen, if at all possible.

Thank you very much!

Gary Ellis

Hi @gellis1 ,

Great questions, and fun game! I would recommend having the student read the documentation for sprite.visible and think about how that block might be useful.

I would also recommend to this student that they should use comments in their code – it would make it easier for other readers to understand what they’re trying to do with each line.

I have recategorized your post to the CSD forum so other folks there might be able to find the post.

Have a great day!
–Michael K.