Move player ticking into the main loop