Can't get text to appear in U3L27 Final Project

[Posts in the debugging category need to have the following pieces of information included in order to help other teachers or our moderator team best help you. Feel free to delete everything in brackets before posting your request for debugging help.]

Link to the project or level: [Game Lab - Code.org}
What I expect to happen: [The textFunction() should display the text on top of Background, then disappear when the spacebar is pressed.]
What actually happens: [The text is not appearing at all]
What I’ve tried: [Initially, the student had the textFunction() at the very bottom of the draw loop under drawSprite(). The text would appear, but it wouldn’t ever disappear. We went through the sample games and decided to try to use Example A as our template and use the same technique. We created an initial backgroundFunction() that included the text below the background animation. We also tried having the background and text in separate functions but called in the “note started” portion of the loop. Text still isn’t appearing. We also tried a bunch of stuff before that, but I can’t remember the details. Mostly, that was trying the textFunction in multiple different positions.]

@sarah.jones,

There are a few ways to approach a problem like this one. Here are links to a few different approaches. In the first link, the approach I usually use is to make the text a variable. I then change the variable to an empty string when the space bar is pressed, so the starting value of the text is the text I want displayed and then when the space bar is pressed, the variable becomes empty text (“”) and it no longer displays.

@melynn, also has a template she teaches to her class so they can learn how to do that. She explains it here.

If your student tries one or more of these approaches and still can’t get it to work, check back in and we’ll try to help debug!

Good luck!

Mike