When player's health is zero, then set a flag to true. Then in your newObject function, check the flag before calling setNextObject function again.

P.