Пример #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)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);
            paddle.Draw(spriteBatch);
            for (int i = 0; i < blocks.Count; i++)
            {
                blocks[i].Draw(spriteBatch);
            }
            ball.Draw(spriteBatch);

            // TODO: Add your drawing code here

            base.Draw(gameTime);
        }
Пример #2
0
 protected override void OnPaint(PaintEventArgs e)
 {
     base.OnPaint(e);
     _paddle.Draw(e);
     {
         for (int i = 0; i < _NumBalls; i++)
         {
             _balls[i].Draw(e);
         }
         foreach (var blk in _blocks)
         {
             blk.Draw(e);
         }
     }
 }
Пример #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.CornflowerBlue);

            // TODO: Add your drawing code here
            renderer.Begin();
            if (!enterPressed)
            {
                Vector2 size     = new Vector2(346, 60);
                Vector2 position = (Constants.SCREEN_SIZE - size) / 2;
                renderer.Draw("Start", position, Color.White);
            }
            table.Draw(gameTime, renderer);
            paddle.Draw(gameTime, renderer);
            ball.Draw(gameTime, renderer);
            renderer.End();
            base.Draw(gameTime);
        }
Пример #4
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();

            paddle.Draw(spriteBatch);
            ball.Draw(spriteBatch);

            foreach (Brick b in bricks)
            {
                b.Draw(spriteBatch);
            }

            spriteBatch.End();

            base.Draw(gameTime);
        }
Пример #5
0
        /// <summary>
        /// Put the paddle on the gameboard.
        /// </summary>
        private void initPaddle()
        {
            paddle = new Paddle(gameBoard);

            paddle.Draw();
        }