# Error with Code for Lesson 17 - Interactive Card

**URL:** <https://forum.code.org/t/error-with-code-for-lesson-17-interactive-card/37715>\
**Category:** Coding and Debugging Help\
**Created:** [March 5, 2023, 9:36pm UTC](https://forum.code.org/t/error-with-code-for-lesson-17-interactive-card/37715 "2023-03-05T21:36:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jennifer.hemry](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/jennifer.hemry/32/4710_2.png) [@jennifer.hemry](https://forum.code.org/u/jennifer.hemry)\
**Post date:** [March 5, 2023, 9:36pm UTC](https://forum.code.org/t/error-with-code-for-lesson-17-interactive-card/37715/1 "2023-03-05T21:36:39Z")

</div>

**Link to the project or level:** [Game Lab - Code.org](https://studio.code.org/projects/gamelab/RQf0Iu7kdEGfbFcMUNbFniRhXAlJRbq5IEYZ_QH6fI4)  
**What I expect to happen:** After clicking 8 or more times, the coin should not repeatedly be seen on the screen. Also, after clicking on each of the backgrounds, they should disappear.  
**What actually happens:** After clicking 8 or more times, the coin is showing up repeatedly on the screen. When clicking on the backgrounds, nothing happens.  
**What I’ve tried:** We have tried moving drawSprites to different locations in the draw loop. We have checked through the code several times.

Thank you!

---

<div class="post-metadata">

**Author:** ![letti42](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@letti42](https://forum.code.org/u/letti42)\
**Post date:** [March 6, 2023, 2:09am UTC](https://forum.code.org/t/error-with-code-for-lesson-17-interactive-card/37715/2 "2023-03-06T02:09:54Z")

</div>

The trick is to use `background("white")` - or any colour you choose - right above the `drawSprites()` function in the draw loop. Once the canvas has been clicked 8 times, the backgrounds will disappear and the text and emoji will show.

---

<div class="post-metadata">

**Author:** ![mwood](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/mwood/32/4941_2.png) [@mwood](https://forum.code.org/u/mwood)\
**Post date:** [March 6, 2023, 4:07pm UTC](https://forum.code.org/t/error-with-code-for-lesson-17-interactive-card/37715/3 "2023-03-06T16:07:17Z")

</div>

@letti42 has given you some good advice that does work, although if you want each background to disappear when you click on it, you will need to add some code for that like you have added for making the balls disappear.

Also, right now, clicking anywhere 8 times will make the animation occur. If you wanted it to be more precise and only occur when each of the balls and each of the backgrounds had been removed, you’d probably have to count when those items disappear rather than counting clicks.

Hopefully this helps you with the next steps!

Mike
