/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { screenWidth = graphics.PreferredBackBufferWidth; screenHeight = graphics.PreferredBackBufferHeight; mainTarget = DefaultTarget; tileTarget = DefaultTarget; entityTarget = DefaultTarget; postTileTarget = DefaultTarget; screenTarget = DefaultTarget; drawingTarget = DefaultTarget; random = new Random(); cameraPosition = Point.Zero; mousePos = new Point(); TextureHandler.Initialize(); GameID.Initialize(); NpcHandler.Initialize(); LevelHandler.Initialize(); TileHandler.Initialize(); base.Initialize(); }
//Initialization and content loading public static void Initialize() { //Creates folder structure if nescessary CreateFolderStructure(); frameCounter = new FrameCounter(); random = new Random(); TextureHandler.Initialize(); InputHandler.Initialize(); FontHandler.Initialize(); displayGames = new DisplayGames(); playerInformationHandler = PlayerInformationHandler.Initialize(); Tick = 0; MouseHandler.Initialize(); store = new Store(playerInformationHandler, (int)States.Store); }