Pong.Paddle.Update C# (CSharp) Method

Update() public method

public Update ( ) : void
return void
        public void Update()
        {
            var newBounds = Bounds.Translate(Velocity);

            if (Playfield.Bounds.Contains(newBounds))
                Bounds = newBounds;
        }

Usage Example

示例#1
0
        protected override void Update(GameTime gameTime)
        {
            gameObjects.TouchInput = new TouchInput();
            GetTouchInput();

            playerPaddle.Update(gameTime, gameObjects);
            computerPaddle.Update(gameTime, gameObjects);
            ball.Update(gameTime, gameObjects);
            score.Update(gameTime, gameObjects);
            //ballOrigin = new Vector2(ballRectangle.Width / 2, ballRectangle.Height / 2); // used for ball spinning
            base.Update(gameTime);
        }
All Usage Examples Of Pong.Paddle::Update
Paddle