So my code broke again?

What’s up with the code randomly breaking here and there? Anyways nothing works and it returns sim error failed cast on undefined and it just points to a random line and when i remove said line it blames it on some other line. Everything worked fine and then it just broke. Here is the code: https://makecode.com/_7riLbrarAApF

It appears that the game doesn’t like adding text sprites to an array.


try removing these

Looks like you forgot to initialize that array you’re using! You need to set “menuText” equal to an empty array before you start adding things to it in a loop. Like this:

(I added the block on top)

1 Like

Thanks, but I figured that one after a while, and I couldn’t delete the post. It seems that for some reason switching to js deleted that block :thinking: