Video game- died but beat the level! glitch

Playing Mr. Do for the arcade, I died but I still beat the level.