public void Initialize() { String PathToUse = "GameData"; if (!System.IO.Directory.Exists(PathToUse)) { PathToUse = "../../GameData"; if (!System.IO.Directory.Exists(PathToUse)) { PathToUse = "../../../../RockBlaster/GameData"; if (!System.IO.Directory.Exists(PathToUse)) { } } } var DataFolderTree = new DataAssetTree(PathToUse); DataAssetCache.Instance.SetAssetTree(DataFolderTree); Entity.GameWidth = (int)Width; Entity.GameHeight = (int)Height; mainMenu = new MainMenu(BoundsRelativeToParent); AddChild(mainMenu); mainMenu.SendToBack(); mainMenu.StartGame += new MainMenu.StartGameEventHandler(StartGame); mainMenu.ShowCredits += new MainMenu.ShowCreditsEventHandler(ShowCredits); mainMenu.ExitGame += new MainMenu.ExitGameEventHandler(ExitGame); howManyPlayersMenu = new HowManyPlayersMenu(BoundsRelativeToParent); AddChild(howManyPlayersMenu); howManyPlayersMenu.SendToBack(); howManyPlayersMenu.StartOnePlayerGame += new HowManyPlayersMenu.StartOnePlayerGameEventHandler(StartOnePlayerGame); howManyPlayersMenu.StartTwoPlayerGame += new HowManyPlayersMenu.StartTwoPlayerGameEventHandler(StartTwoPlayerGame); howManyPlayersMenu.StartFourPlayerGame += new HowManyPlayersMenu.StartFourPlayerGameEventHandler(StartFourPlayerGame); howManyPlayersMenu.CancelMenu += new HowManyPlayersMenu.CancelMenuEventHandler(BackToMainMenu); creditsMenu = new CreditsMenu(BoundsRelativeToParent); AddChild(creditsMenu); creditsMenu.SendToBack(); creditsMenu.CancelMenu += new CreditsMenu.CancelMenuEventHandler(BackToMainMenu); playfield = new PlayfieldView(BoundsRelativeToParent); AddChild(playfield); playfield.SendToBack(); playfield.Menu += new PlayfieldView.MenuEventHandler(EndGame); playfield.Visible = false; MakeMenuVisibleHideOthers(mainMenu); }