I'm using C3's pac-man (Eat 'em all) template to create a game.
I've added coins.
If the player collects 10 coins before he dies, he can continue on without starting over. If he doesn't have 10 coins, the game restarts.
I set the coins variable to 50 for testing.
When the player dies he gets a green square, if he clicks on the green square, the game should start where it left off, with 1 life.
The game does start with the same amount of missing dots, but when the ghost collide with the player, the player no longer dies. That's kind of an issue.
I can't seem to get the ghost to kill the player after the player uses coins. The player seems to be able to eat the ghosts after eating a big dot and eat the little dots and when all the dots are gone the player does win.
The only problem is the ghosts no longer kill pacman when they collide.
This is the edited demo: drive.google.com/file/d/10yNr7nUqDX1swKLw8gooxMb4gmH6Y52s/view