Beispiel #1
0
 public Save()
 {
     _objTracker = new ObjectiveTracker();
     _playerStats = new PlayerStats();
     _playerStats.SetToDefault();
     _currentLevel = GameMode.None;
     _progress = 0;
 }
Beispiel #2
0
        private void BackgroundThread_FileLoad()
        {
            IsLoadingContent = true;
            if (_gameWorld.TryLoadFromFile(CurrentGameMode))
            {
                ObjectiveTracker = GameData.CurrentSave.ObjTracker;
            }
            else
            {
                CurrentGameMode = GameMode.None;
                CurrentGameState = GameState.MainMenu;
            }

            IsLoadingContent = false;
            WasPressed = false;
        }
Beispiel #3
0
        protected override void Initialize()
        {
            Camera = new Camera(GraphicsDevice.Viewport);
            _menu = new Menu(this);
            _gameWorld = new GameWorld(this);
            Player = new Player.Player(this);
            _overlay = new Overlay();
            _cutscene = new Cutscene();
            Dialog = new Dialog();
            ObjectiveTracker = new ObjectiveTracker();
            MessageBox = new MessageBox();
            TextInputBox = new TextInputBox();

            DefaultTexture = ContentHelper.LoadTexture("Tiles/temp tile");
            GraphicsDeviceInstance = _graphics.GraphicsDevice;

            //Initialize the game render target
            _mainRenderTarget = new RenderTarget2D(GraphicsDevice, DefaultResWidth, DefaultResHeight, false,
                GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24,
                GraphicsDevice.PresentationParameters.MultiSampleCount, RenderTargetUsage.PreserveContents);
            _lightingRenderTarget = new RenderTarget2D(GraphicsDevice, DefaultResWidth, DefaultResHeight, false,
                GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24,
                GraphicsDevice.PresentationParameters.MultiSampleCount, RenderTargetUsage.PreserveContents);

            SpriteBatch = new SpriteBatch(GraphicsDevice);

            _lightBlendState = new BlendState
            {
                AlphaSourceBlend = Blend.DestinationColor,
                ColorSourceBlend = Blend.DestinationColor,
                ColorDestinationBlend = Blend.Zero
            };

            base.Initialize();
        }