My students are working on the interactive card project for U3 L18, and I’m wondering what is the best way is to keep a message displayed on the screen within a draw loop once it is triggered by button or mouse input?
Students are familiar with the keyDown
and mouseDown
commands, but that only works while the user holds the key down. I thought keyWentDown
would be a step in the right direction, but it only works until the draw loop updates.
Here’s a working example of what I currently have, where the intended behavior is for the message to stay on the screen after pressing ‘m’ while the program runs.
I suppose I could do something like a simple Boolean variable, but wonder if I’m missing something with the yellow blocks.