I’m creating a trivia game for a school project, but I am now forced to set all the correct answers as the first option. This is due to the unfortunate fact that each time I press a different arrow key, it turns into grayscale and kicks me out, showing the message “Program Error: Cannot read properties of undefined (reading ‘fields’)”. I’ve tried to use JavaScript to debug it, but nothing I did helped resolve this issue. Could anyone please provide any support? ( My game link is https://arcade.makecode.com/S79146-98804-55329-01128 ) Thank you!
When you’re clicking down it’s trying to animate a sprite that doesn’t exist. In order to toggle this create a variable on the start called
Var = “mySprite4 created” and set it to true by adding from the logic category a block called true and drag it into the part of the variable that has a number. Then set it to false. When you create this sprite in scene 3 set it to true. Next on each of the on up/down/left/right triggers add the if block to it. Drag in the logic category the 0 = 0 block and put it in the part of the if block that says true. Drag an oval block that reads mySprite4 created from the variable category and snap it onto the first 0. Drag another true block from the logic category and put it in the second 0 this will then only do that action when the sprite is created and you should be able to go up and down.
I think what wrong is that when choosing answers there are also animations in the
*If Up Pressed Block
*If Down Pressed Block
*If Left Pressed Block
*If Right Pressed Block
And you also have an animation in the A block that can overlap near the end of the game.
And due to sprites not existing yet in your game it doesn’t work and crashes. Some ways you may want to fix it is my using a variable and setting it to True when the segment that uses those animations comes up
Or you could use the Animations Extension in the Extensions tab to make the process alot easier
Hopefully this helps
Thank you!
This helped a lot, very much appreciated