# Interactive Card Project

**URL:** <https://forum.code.org/t/interactive-card-project/39456>\
**Category:** CS Discoveries\
**Tags:** csd-unit-3\
**Created:** [May 13, 2024, 5:55pm UTC](https://forum.code.org/t/interactive-card-project/39456 "2024-05-13T17:55:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![tracy.graysonpeters](https://avatars.discourse-cdn.com/v4/letter/t/e99b99/32.png) [@tracy.graysonpeters](https://forum.code.org/u/tracy.graysonpeters)\
**Post date:** [May 13, 2024, 5:55pm UTC](https://forum.code.org/t/interactive-card-project/39456/1 "2024-05-13T17:55:45Z")

</div>

> **[Check out what I made](https://studio.code.org/projects/gamelab/Qw4OxOgSwpZtHHc4Qmy_V7hnXk1ojlh1917Idmcf3mU)**
>
> I wrote the code myself with Code.org

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!

---

<div class="post-metadata">

**Author:** ![paul.rallion](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/paul.rallion/32/7218_2.png) [@paul.rallion](https://forum.code.org/u/paul.rallion)\
**Post date:** [May 13, 2024, 10:21pm UTC](https://forum.code.org/t/interactive-card-project/39456/2 "2024-05-13T22:21:25Z")

</div>

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

> **[Check out what I made](https://studio.code.org/projects/gamelab/hyp6LAnBSpGJnZmHcO8ARdnC97uv1wJ2Rv7ie_vaEvM)**
>
> I wrote the code myself with Code.org

I hope that helps,  
Paul

---

<div class="post-metadata">

**Author:** ![tracy.graysonpeters](https://avatars.discourse-cdn.com/v4/letter/t/e99b99/32.png) [@tracy.graysonpeters](https://forum.code.org/u/tracy.graysonpeters)\
**Post date:** [May 14, 2024, 5:27pm UTC](https://forum.code.org/t/interactive-card-project/39456/3 "2024-05-14T17:27:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mriley](https://avatars.discourse-cdn.com/v4/letter/m/53a042/32.png) [@mriley](https://forum.code.org/u/mriley)\
**Post date:** [May 14, 2024, 5:50pm UTC](https://forum.code.org/t/interactive-card-project/39456/4 "2024-05-14T17:50:20Z")

</div>

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](https://studio.code.org/projects/gamelab/mcVXvmlOzoOOmrFxxvx-DwLFfl7m3pDn-FbAVVXbi7o)

---

<div class="post-metadata">

**Author:** ![paul.rallion](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/paul.rallion/32/7218_2.png) [@paul.rallion](https://forum.code.org/u/paul.rallion)\
**Post date:** [May 14, 2024, 6:01pm UTC](https://forum.code.org/t/interactive-card-project/39456/5 "2024-05-14T18:01:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tracy.graysonpeters](https://avatars.discourse-cdn.com/v4/letter/t/e99b99/32.png) [@tracy.graysonpeters](https://forum.code.org/u/tracy.graysonpeters)\
**Post date:** [May 15, 2024, 8:15pm UTC](https://forum.code.org/t/interactive-card-project/39456/6 "2024-05-15T20:15:58Z")

</div>

Thank you for the suggestions! It worked!!
