Trouble with game running very slowly

My student has created a “Pacman” type of game, but it runs so slowly that it would not be fun to play. We are thinking the problem might have something to do with the code checking a conditional often, but we are not sure. He has tried increasing the worldFrame rate but that doesn’t seem to affect the program when he runs it. Here is the link to his game.
https://studio.code.org/projects/gamelab/JWaCtkp1zIhVACgICWp5JAqiaM8fmXFg5pphm6rUzUs

Molly,

Good thinking - but the problem, that I can see, is inside the draw loop the student is calling the maze and border functions, so EVERY frame they are being redrawn. I remixed and pulled those two functions before the draw loop and it was much smoother.

It’s an impressive game! Congrats!

Brad