All the complex stuff I couldn't figure out how to do, you did beautifully.
But there is one administrative detail which I added to your program (see post this is a response to).
Namely, when you die or escape or complete the game, you need a little time to copy down the score.
Heh - reminds me of my concept of death - One moment you are in the game, the next - poof! - game over. Nothing you ever did on Earth counts for anything. All people are equals. Bill Gates, the guy who took my garbage this morning, Jesus, Mohammed, Budda, ComputerGhost and Mac - all the same: null and void - finito, period, etc.
So in that sense, your game was realistic, but I fixed it anyway to simulate a little life after death - a moment to savor or regret actions taken.
If you like, I could replace your original version with this and delete this post. Or I could just delete this post. Whatever - It's your section of the forum.