示例#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);

            // TODO: Add your drawing code here
            spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend);
            spriteBatch.Draw(background, new Vector2(0, 0), Color.White);

            bola.dibujar(spriteBatch);
            jugador.draw(spriteBatch);

            i++;
            if (cursor[i].vivo == false)
            {
                cursor[i].dibujarCursor(spriteBatch, bola.posicion);
            }
            for (int a = 1; a < 100; a++)
            {
                if (cursor[a].vivo == true)
                {
                    cursor[a].dibujarCursor(spriteBatch, bola.posicion);
                }
            }

            spriteBatch.DrawString(font, "Puntaje: " + puntaje, new Vector2(150, 45), Color.Yellow);
            spriteBatch.End();
            base.Draw(gameTime);
        }
示例#2
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
            spriteBatch.Begin();
            bola.dibujar(spriteBatch);
            jugador.draw(spriteBatch);
            spriteBatch.End();
            base.Draw(gameTime);
        }