Beispiel #1
0
        protected override void LoadContent()
        {
            Globals.SpriteBatch = new SpriteBatch(GraphicsDevice);

            Assets.Load();
            MainMap.Load();
            CameraSystem.Load();
            WallSystem.Load();
            Player.Load();
        }
Beispiel #2
0
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(new Color(0f, .05f, .1f, 1f));

            Globals.SpriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, SamplerState.PointClamp, DepthStencilState.Default, RasterizerState.CullNone, transformMatrix: CameraSystem.MainCamera.Transform);

            MainMap.Draw();
            WallSystem.Draw();
            Player.Draw();

            Globals.SpriteBatch.End();

            base.Draw(gameTime);
        }
Beispiel #3
0
        protected override void Update(GameTime gameTime)
        {
            Input.UpdateState();

            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed ||
                Input.IsKeyPressed(Input.KeyMap["quit"]))
            {
                Exit();
            }

            Time.GameTime  = gameTime;
            Time.DeltaTime = (float)gameTime.ElapsedGameTime.TotalMilliseconds;

            Player.Update();
            WallSystem.Update();
            CameraSystem.Update();

            base.Update(gameTime);
        }