Пример #1
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            string positionInText = string.Format("Position of Jumper: ({0:0.0},{1:0.0})", _jumper.Position.X, _jumper.Position.Y);
            string movementInText = string.Format("Current Movement: ({0:0.0},{1:0.0})", _jumper.Movement.X, _jumper.Movement.Y);

            GraphicsDevice.Clear(Color.WhiteSmoke);
            _spriteBatch.Begin();
            base.Draw(gameTime);
            _board.Draw();
            _spriteBatch.DrawString(_debugFont, positionInText, new Vector2(10, 0), Color.White);
            _spriteBatch.DrawString(_debugFont, movementInText, new Vector2(10, 20), Color.White);
            _jumper.Draw();
            _spriteBatch.End();
        }
        protected override void Draw(GameTime gameTime)
        {
            string positionInText =
                string.Format("Position of Jumper: ({0:0.0}, {1:0.0})", _jumper.Position.X, _jumper.Position.Y);
            string movementInText =
                string.Format("Current movement: ({0:0.0}, {1:0.0})", _jumper.curSpeed.X, _jumper.curSpeed.Y);

            string isOnFirmGroundText = string.Format(" On firm ground ? : {0}", _jumper.IsOnFirmGround());

            GraphicsDevice.Clear(Color.Aqua);
            _spriteBatch.Begin();
            base.Draw(gameTime);
            _board.Draw();
            _spriteBatch.DrawString(_debugFont, positionInText, new Vector2(10, 0), Color.White);
            _spriteBatch.DrawString(_debugFont, movementInText, new Vector2(10, 20), Color.White);
            _spriteBatch.DrawString(_debugFont, isOnFirmGroundText, new Vector2(10, 40), Color.White);
            _jumper.Draw();
            _spriteBatch.End();
        }