RunningOutOfPower/RunPower/RunPower/InvincibleGame.cs
/// <summary>
/// This is called when the game should draw itself.
/// </summary>
/// <param name="gameTime">Provides a snapshot of timing values.</param>
This is called when the game should draw itself.
This is called when the game should draw itself .
protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);
            var sourceRectangle = new Rectangle(0, 0, _viewportAdapter.VirtualWidth, _viewportAdapter.VirtualHeight);
            sourceRectangle.Offset(_camera.Position * new Vector2(0.1f));
            _spriteBatch.Begin(samplerState: SamplerState.PointWrap, transformMatrix: _viewportAdapter.GetScaleMatrix());
            _spriteBatch.Draw(_backgroundTexture, Vector2.Zero, sourceRectangle, Color.White);
            _spriteBatch.DrawString(_font, $"V:{_player.Velocity} Pos:{_player.Position.X},{_player.Position.Y} R:{_player.Rotation} ", Vector2.One, Color.White);
            _spriteBatch.End();
            _spriteBatch.Begin(samplerState: SamplerState.PointClamp, blendState: BlendState.AlphaBlend, transformMatrix: _camera.GetViewMatrix());
            _entityManager.Draw(_spriteBatch);
            _spriteBatch.End();
            _spriteBatch.Begin(transformMatrix: _camera.GetViewMatrix());
            _spriteBatch.End();
            base.Draw(gameTime);
        }
protected override void Draw ( GameTime gameTime ) { GraphicsDevice . Clear ( Color . CornflowerBlue ) ; var sourceRectangle = new Rectangle ( 0 , 0 , _viewportAdapter . VirtualWidth , _viewportAdapter . VirtualHeight ) ; sourceRectangle . Offset ( _camera . Position * new Vector2 ( 0.1f ) ) ; _spriteBatch . Begin ( samplerState : SamplerState . PointWrap , transformMatrix : _viewportAdapter . GetScaleMatrix ( ) ) ; _spriteBatch . Draw ( _backgroundTexture , Vector2 . Zero , sourceRectangle , Color . White ) ; _spriteBatch . DrawString ( _font , $" V: { _player . Velocity }  Pos: { _player . Position . X } , { _player . Position . Y }  R: { _player . Rotation } " , Vector2 . One , Color . White ) ; _spriteBatch . End ( ) ; _spriteBatch . Begin ( samplerState : SamplerState . PointClamp , blendState : BlendState . AlphaBlend , transformMatrix : _camera . GetViewMatrix ( ) ) ; _entityManager . Draw ( _spriteBatch ) ; _spriteBatch . End ( ) ; _spriteBatch . Begin ( transformMatrix : _camera . GetViewMatrix ( ) ) ; _spriteBatch . End ( ) ; base . Draw ( gameTime ) ; }
This is called when the game should draw itself.
This is called when the game should draw itself .
// TODO: Add your drawing code here // entities //camera
gameTime
GameTime
Provides a snapshot of timing values.
Provides a snapshot of timing values .