Interactive card lesson 17 help - making "happy birthday" visible on click

The student I am working with wants to make the words happy birthday visible when the mouse is pressed down on the third raccoon (named raccoon2). When the mouse is let go she wants the words happy birthday to stay there. I’m thinking she needs to change her text to a sprite to do this. Thoughts?

1 Like

Here’s how I did it: https://studio.code.org/projects/gamelab/VYiOFEiDE8z840elQIxJHqAEEJPDvD_7cpxdQtChAm4/edit
and no, she doesn’t need to create a text sprite to do this. What she was doing wrong, is that she was printing the text only once and then drawing the sprites infinitely, what was happening was that the sprites were overlapping the text, and the text was hidden right after the sprites were getting drawn. In what i did, i was drawing the sprites infinitely as well, and even if they were overlapped, they were getting drawn again because of function draw.

1 Like

Hi @heath.kelley,

What a cool game! @IMPixel’s solution is one way to get it to work. Another way is to set up a variable that is initially set to false, and then it turns true once that raccoon has been clicked. Then, set the text to be visible at the very end of the draw loop if that variable is true.

There’s lots of ways to get this to work – hopefully something that one of us said will help you get it! Please report back here if you need further assistance.

Thanks,

–Michael K.

1 Like