# Debug function in Arcade game

**URL:** https://forum.makecode.com/t/debug-function-in-arcade-game/2750
**Category:** Help
**Created:** [July 12, 2020, 5:36pm UTC](https://forum.makecode.com/t/debug-function-in-arcade-game/2750 "2020-07-12T17:36:47Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Jackyu](https://avatars.discourse-cdn.com/v4/letter/j/ccd318/32.png) [@Jackyu](https://forum.makecode.com/u/Jackyu)
#### Post date: [July 12, 2020, 5:36pm UTC](https://forum.makecode.com/t/debug-function-in-arcade-game/2750/1 "2020-07-12T17:36:47Z")

</div>

Hi all,

Thanks for your help in advance.

I just started to use block code in Arcade, and want to check the value of variable, so that i can check the system logic for the code i build. but i coud not find debug function in the editor interface. when i try to do the research in Google, no direct answers or help functions are available. I found one function of conslove, but do not know how to use it.

Here is the link of my code: [https://makecode.com/\_9AbE0paWo2iR](https://makecode.com/_9AbE0paWo2iR), in particular, i want to check the variable value of “projectile”, so that i can evluate the system logic, which is very common for the debug process in any IDE interface.

 ![图片](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/8/8e85e438963369df0c7f481a1cdc2eb192945119.png)

---

<div class="post-metadata">

### Author: ![GameGod](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/gamegod/32/2756_2.png) [@GameGod](https://forum.makecode.com/u/GameGod)
#### Post date: [July 12, 2020, 5:40pm UTC](https://forum.makecode.com/t/debug-function-in-arcade-game/2750/2 "2020-07-12T17:40:30Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/c/c85b85aff560142f2046742aeb002c3e0687d7b7.png)

---

<div class="post-metadata">

### Author: ![jwunderl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jwunderl/32/5308_2.png) [@jwunderl](https://forum.makecode.com/u/jwunderl)
#### Post date: [July 12, 2020, 7:30pm UTC](https://forum.makecode.com/t/debug-function-in-arcade-game/2750/3 "2020-07-12T19:30:42Z")

</div>

Also, if you click the little triangle on the left side of the block it will show a message saying what’s wrong. (In this case, it’s saying that the log value block accepts a number for that slot instead of just any given type - the regular log block will output anything though. Might be able to fix that for the next release)

I’d also note that projectile will always be undefined there - on start runs before on game update, so no projectile will have been made at that point.

---

<div class="post-metadata">

### Author: ![Jackyu](https://avatars.discourse-cdn.com/v4/letter/j/ccd318/32.png) [@Jackyu](https://forum.makecode.com/u/Jackyu)
#### Post date: [July 13, 2020, 3:11am UTC](https://forum.makecode.com/t/debug-function-in-arcade-game/2750/4 "2020-07-13T03:11:15Z")

</div>

Thanks GameGod, now i know this function. Many thanks.

To put my contnet in my sepific, i like to show the value of varialbe during the program, so that i think the below block will be more useful then the debug mode, which is to fix the easy error before go to the larger error checking in debug mode.

 ![图片](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/6/6a462ebabdcc3f50d90e219c1b84fc06dbbb5765.png)

it is located in the sprites group with the block called “sprites say…”.

with such help, i finally tracked down the bug, and make the correction accordingly.

Here is the linkage for the new version of code: [https://makecode.com/\_FTJbRRYEkfv4](https://makecode.com/_FTJbRRYEkfv4)

Thanks a lots for building such a great platform for code learning.

Jack
