# CSD Unit 3:Lesson 14 Interactive Card

**URL:** <https://forum.code.org/t/csd-unit-3-lesson-14-interactive-card/15699>\
**Category:** Unit and Lesson Discussion\
**Tags:** csd-unit-3, csd-unit-3-lesson-14\
**Created:** [April 20, 2018, 4:16pm UTC](https://forum.code.org/t/csd-unit-3-lesson-14-interactive-card/15699 "2018-04-20T16:16:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ccagle](https://avatars.discourse-cdn.com/v4/letter/c/ac91a4/32.png) [@ccagle](https://forum.code.org/u/ccagle)\
**Post date:** [April 20, 2018, 4:16pm UTC](https://forum.code.org/t/csd-unit-3-lesson-14-interactive-card/15699/1 "2018-04-20T16:16:12Z")

</div>

One of my students is having a problem with the .visible command. He wants the door to disappear when the mouse button is clicked. He has it set so if the condition is met (mousebutton down) then door.visible=false but the door won’t disappear. Any ideas?

Here’s a link to his project.

[https://studio.code.org/projects/gamelab/n8Xrz1OzR72yHJ3CfNNGVCMRpdCgssYE1J3cU0somBw](https://studio.code.org/projects/gamelab/n8Xrz1OzR72yHJ3CfNNGVCMRpdCgssYE1J3cU0somBw)

---

<div class="post-metadata">

**Author:** ![elizabeth\_admin](https://avatars.discourse-cdn.com/v4/letter/e/bb73d2/32.png) [@elizabeth\_admin](https://forum.code.org/u/elizabeth_admin)\
**Post date:** [April 20, 2018, 4:40pm UTC](https://forum.code.org/t/csd-unit-3-lesson-14-interactive-card/15699/2 "2018-04-20T16:40:50Z")

</div>

@ccagle

Hi Chantal,

In the if statement, the door disappears when the mouse goes down, but then it is immediately made visible again on the next iteration of the draw loop, because the mouse _didn’t_ go down the next time. If you remove the “else make the door visible again” part of the code, the door should stay invisible. When exactly did the student want the door to be visible again?

Elizabeth

---

<div class="post-metadata">

**Author:** ![ccagle](https://avatars.discourse-cdn.com/v4/letter/c/ac91a4/32.png) [@ccagle](https://forum.code.org/u/ccagle)\
**Post date:** [April 20, 2018, 5:00pm UTC](https://forum.code.org/t/csd-unit-3-lesson-14-interactive-card/15699/3 "2018-04-20T17:00:13Z")

</div>

We tried that and the door never becomes invisible at all. See my remixed example below. I’m not sure what his next step is because we’ve been stuck on making the door disappear!

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

---

<div class="post-metadata">

**Author:** ![elizabeth\_admin](https://avatars.discourse-cdn.com/v4/letter/e/bb73d2/32.png) [@elizabeth\_admin](https://forum.code.org/u/elizabeth_admin)\
**Post date:** [April 20, 2018, 6:31pm UTC](https://forum.code.org/t/csd-unit-3-lesson-14-interactive-card/15699/4 "2018-04-20T18:31:05Z")

</div>

Okay, I see the problem now. You’re actually just still seeing the door from when the sprite was visible before in the draw loop, because you’re not covering up the old sprites. (The house sprite has a gap where the door should be, so the old door from previous iterations of the draw loop is showing through, even though it’s not visible in the current iterations of the draw loop).

At the beginning of the draw loop, add a `background("black")` or `background("white")` to your code, and it should work.

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

Elizabeth

---

<div class="post-metadata">

**Author:** ![ccagle](https://avatars.discourse-cdn.com/v4/letter/c/ac91a4/32.png) [@ccagle](https://forum.code.org/u/ccagle)\
**Post date:** [April 20, 2018, 6:43pm UTC](https://forum.code.org/t/csd-unit-3-lesson-14-interactive-card/15699/5 "2018-04-20T18:43:31Z")

</div>

Great! I’ll pass this on to the student on Monday. He’s going to be glad to move on as this has been frustrating him. You are a big help!
