public ScoreData Load() { ScoreData s = Storage.LoadXml<ScoreData>(fileName); if (s == null) { s = new ScoreData(); s.LoadDefault(); } return s; }
/// <summary> /// The main game constructor. /// </summary> public BitSitsGames() { Content.RootDirectory = "Content"; graphics = new GraphicsDeviceManager(this); ScoreData = ScoreData.Load(GameContent.MaxLevelIndex); Settings = Settings.Load(); #if WINDOWS graphics.IsFullScreen = Settings.IsFullScreen; ViewportSize = new Vector2(800, 600); #endif #if WINDOWS_PHONE TargetElapsedTime = TimeSpan.FromTicks(333333); ViewportSize = new Vector2(640, 480); graphics.IsFullScreen = true; #endif graphics.PreferredBackBufferWidth = (int)ViewportSize.X; graphics.PreferredBackBufferHeight = (int)ViewportSize.Y; IsMouseVisible = true; // Create the screen manager component. screenManager = new ScreenManager(this, graphics); Components.Add(screenManager); #if WINDOWS //graphics.MinimumPixelShaderProfile = ShaderProfile.PS_2_0; bloom = new BloomComponent(this); Components.Add(bloom); bloom.Settings = BloomSettings.PresetSettings[5 % BloomSettings.PresetSettings.Length]; #endif #if DEBUG && WINDOWS Components.Add(new DebugComponent(this)); //Level Menu LoadingScreen.Load(screenManager, false, null, new BackgroundScreen(), new MainMenuScreen()); //LoadingScreen.Load(screenManager, false, PlayerIndex.One, new BackgroundScreen(), new MainMenuScreen() // , new LabScreen()); //LoadingScreen.Load(screenManager, false, PlayerIndex.One, new GameplayScreen()); #else //graphics.IsFullScreen = true; LoadingScreen.Load(screenManager, true, null, new BackgroundScreen(), new MainMenuScreen()); #endif }
/// <summary> /// The main game constructor. /// </summary> public BitSitsGames() { Content.RootDirectory = "Content"; graphics = new GraphicsDeviceManager(this); Camera2D.BaseScreenSize = new Vector2(800, 600); Settings = Settings.Load(); ScoreData = ScoreData.Load(); #if WINDOWS graphics.PreferredBackBufferWidth = 800; graphics.PreferredBackBufferHeight = 600; graphics.IsFullScreen = Settings.IsFullScreen; graphics.PreferredBackBufferWidth = Settings.Resolutions[Settings.CurrentResolution].X; graphics.PreferredBackBufferHeight = Settings.Resolutions[Settings.CurrentResolution].Y; #endif #if WINDOWS_PHONE TargetElapsedTime = TimeSpan.FromTicks(333333); graphics.PreferredBackBufferWidth = 640; graphics.PreferredBackBufferHeight = 480; graphics.IsFullScreen = true; #endif Camera2D.ResolutionScale = (float)graphics.PreferredBackBufferWidth / Camera2D.BaseScreenSize.X; IsMouseVisible = true; // Create the screen manager component. screenManager = new ScreenManager(this, graphics); Components.Add(screenManager); #if DEBUG Components.Add(new DebugComponent(this)); // TEST LEVELS LoadingScreen.Load(screenManager, false, PlayerIndex.One, new GameplayScreen()); #else //LoadingScreen.Load(screenManager, false, null, new QuickMenuScreen()); LoadingScreen.Load(screenManager, true, null, new BackgroundScreen(), new MainMenuScreen()); #endif }