# Debug help CSD Lesson 18

**URL:** <https://forum.code.org/t/debug-help-csd-lesson-18/40545>\
**Category:** CS Discoveries\
**Tags:** csd-unit-3\
**Created:** [March 13, 2025, 2:36pm UTC](https://forum.code.org/t/debug-help-csd-lesson-18/40545 "2025-03-13T14:36:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lorikaye](https://avatars.discourse-cdn.com/v4/letter/l/dc4da7/32.png) [@lorikaye](https://forum.code.org/u/lorikaye)\
**Post date:** [March 13, 2025, 2:36pm UTC](https://forum.code.org/t/debug-help-csd-lesson-18/40545/1 "2025-03-13T14:36:22Z")

</div>

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

We think the problem with code is starting on line 114

**What should happen:**

When you click inside the fireplace 2 times, the fire1, 2, 3 variable should choose a random number. When the number is == 16 the fire sprites should become visible.

**What is happening:**

fire1 and fire2 sprites are not becoming visible. Student debugged by setting all variables to 16. Only fire.visible == true would work. When he put in a watcher, fire1.visible it just said undefined.

As I’m writing this I’m wondering if a variable can have the same label as a sprite (see line 115 and line 123).

Also, he cannot go back into blocks. It says there is an error, but he’s not getting an error message with a line to check.

---

<div class="post-metadata">

**Author:** ![pluto](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/pluto/32/9141_2.png) [@pluto](https://forum.code.org/u/pluto)\
**Post date:** [March 13, 2025, 4:17pm UTC](https://forum.code.org/t/debug-help-csd-lesson-18/40545/2 "2025-03-13T16:17:54Z")

</div>

Greetings @lorikaye,

* * *

I believe the problem is the fact that you cannot have the same name for 2 different variables (as you mentioned in your post already).  
It will simply think it’s the same single variable, so I suggest you give them different names.

The issue with it not turning into blocks is because of an extraneous semicolon here.

![image](https://us1.discourse-cdn.com/flex016/uploads/codeorgforum/original/2X/e/e75dbca3791bd2c848e648ab6b9ce22fb70e3a70.png)

* * *

Sincerely, @pluto
