Interactive Card Project

Student is trying to make the present and text Press Space bar show up when program is run. When Space Bar is pressed, student wants present to disappear and neon, neon2 and sticker sprites to appear and present to disappear, and text to say Happy Mother’s Day… Can you please look at this code and explain what needs to be done to fix it. Thanks!

Hi tracy.graysonpeters,
Welcome to our community! :blush:
I rearranged some lines, hopefully this is what the student intended:

I hope that helps,
Paul

Hi Paul,

thanks for your reply…

Not quite… the student wants the neons and sticker to disappear and the present to reappear when the spacebar key is released.

Several students are having difficulty with the sprite.visible line of code… Perhaps more explanation and practice would be helpful .

Tracy

Some mistakes in the original.
First you cant create the sprite variables in the drawloop, that’s a big no no. It creates them over and over again.
The draw sprites block should not be in the IF statement, it should be outside of the IF statement but in the draw loop
The present should be set to visible false in the IF statements but visible true in the ELSE
take a look

1 Like

Thanks for repositioning the lines I left out of “if/else:”
sprite.visible = false
Nice work, thanks! :+1:t3:

1 Like

Thank you for the suggestions! It worked!!