Getting text to disappear once another key is pressed


Student wants text (hold right) to disappear once the santa gets right in the center and press space appears.


This project is amazing! Would you mind if I used it as an exemplar with my students?

This bug was somewhat tricky to spot. The problem is occurring because the text is showing whenever x is not equal to 200 (lines 25-32 in the code). The student could quickly fix this by changing line 27 from a standard else clause to else if (santa.x < 200). This way, if Santa is in the middle of the screen, or anywhere to right, the message won’t show.


Yes, you may use it! :slight_smile: I can’t wait to tell him.