All "wait" does is pause the system for a given period of time and then go to the next action, whatever it is. Obviously, you want the player to be able to take action, removing the pizza from the floor before the five seconds is up. I think each pizza instance needs an instance variable that increments by one for every second that the instance is touching the floor, and when that variable hits 5 for any pizza instance, the game is over. If the player removes the pizza instance from the floor, the instance variable needs to be reset to zero for that instance. The "wait" action is not needed.