I am making an RPG, but every time the battle ends, the game crashes. Please help, I don’t know how to fix this. here is the link
btw arrow keys or wasd to move, and to activate battle just move around and try to go onto a different grass block. (it just looks different)
1 Like
Tip: The JavaScript section tells you where the errors are in the code. Then, you can look at what it says has an error and try to find it in the blocks.
It seems like the error is happening in the “enemyattackcheck” function, but I don’t understand what is happening, so I can’t diagnose exactly where the error is.
Hope this is helpful.
I would recommend playing the game in Debug Mode so that it shows you the actual error instead of just the “sim error…” whatever.
It looks like you call this function even after the game is over, so the status bar tries to update even though it doesn’t exist anymore! This is causing the error.
Thanks for your help, but It should not do that function in the first place, that was the problem. I already knew about debug mode
.
1 Like
In that case, if you can’t find the cause, you can just add a check using another variable, like a “inBattleMod” variable or smth, idk.