replace timer for the player with frame detection