Changed "if( GameManager.state )" statements to switch statements