Hi everyone,
I’m currently making a game in MakeCode Arcade, and I’m running into a weird issue with sprite flags. I have some logic that updates sprite flags based on certain conditions.
Here’s what I noticed:
- When I use
on game update, everything works fine—even when I trigger
mp.gameOverPlayerWin(mp.playerSelector(mp.PlayerNumber.One))
OR
game.gameOver(true)
-
But when I use a
foreverloop, I get this error:Program Error: sim error: failed cast on undefined
I made a couple of example projects:
In the forever example, clicking A is supposed to run game.over(player 1 wins), but it fails with the error above. In the on-game update example, it works perfectly.
I’m wondering why using a forever loop with a pause causes this error, but using on game update every 100 ms does not.
Any ideas on how to fix this or why it’s happening?
Thanks!
