Added check to avoid running game logic during resize events