Пример #1
0
 internal void Draw(SpriteBatch spriteBatch)
 {
     spriteBatch.Draw(backgroundTexture, new Vector2(0f, 0f), Color.White);
     playerOne.Draw(spriteBatch);
     playerTwo.Draw(spriteBatch);
     ball.Draw(spriteBatch);
     spriteBatch.DrawString(font, playerOneScore.ToString(), playerOneScorePosition, green);
     spriteBatch.DrawString(font, playerTwoScore.ToString(), playerTwoScorePosition, green);
 }
Пример #2
0
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);

            _spriteBatch.Begin();
            _ball.Draw(_spriteBatch);
            _left_paddle.Draw(_spriteBatch);
            _right_paddle.Draw(_spriteBatch);
            _spriteBatch.End();

            base.Draw(gameTime);
        }
Пример #3
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)
        {
            GraphicsDevice.Clear(Color.Black);

            spriteBatch.Begin();
            ball.Draw(spriteBatch);
            paddle1.Draw(spriteBatch);
            paddle2.Draw(spriteBatch);
            scoreBoard.Draw(spriteBatch);
            spriteBatch.End();

            base.Draw(gameTime);
        }
Пример #4
0
        private void wnd_Loaded(object sender, RoutedEventArgs e)
        {
            timer          = new DispatcherTimer();
            timer.Tick    += new EventHandler(timer_Tick);
            timer.Interval = new TimeSpan(0, 0, 0, 0, 15);

            ball = new Ball(350, 175, 200, 200, dlg.Radius);
            ball.Draw(Cvs);
            //ball.startPosition(RectFeld);

            paddle1 = new Paddle(dlg.paddleHoehe, dlg.paddleBreite);
            paddle1.position(144, 119);
            paddle1.draw(Cvs);

            paddle2 = new Paddle(dlg.paddleHoehe, dlg.paddleBreite);
            paddle2.position(144, 559);
            paddle2.draw(Cvs);

            uhr = new Uhr(Cvs, 690, 80);
            uhr.draw(Cvs);

            paddleSpeed = 15;
            extraSpeed  = 1.2;
        }