Debug function in Arcade game

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, 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.

image

1 Like

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.

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.

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

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

Jack