/// <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);

            // STUDENTS: draw rocks
            spriteBatch.Begin();

            if (rock1 != null)
            {
                rock1.Draw(spriteBatch);
            }

            if (rock2 != null)
            {
                rock2.Draw(spriteBatch);
            }

            if (rock3 != null)
            {
                rock3.Draw(spriteBatch);
            }

            spriteBatch.End();

            base.Draw(gameTime);
        }
Example #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);

            // STUDENTS: draw rocks
            spriteBatch.Begin();

            //check if rocks are null so there are no exceptions
            if (rock0 != null)
            {
                rock0.Draw(spriteBatch);
            }
            if (rock1 != null)
            {
                rock1.Draw(spriteBatch);
            }
            if (rock2 != null)
            {
                rock2.Draw(spriteBatch);
            }

            spriteBatch.End();

            base.Draw(gameTime);
        }
Example #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);

            // draw rock sprites
            spriteBatch.Begin();
            rock0.Draw(spriteBatch);
            rock1.Draw(spriteBatch);
            rock2.Draw(spriteBatch);
            spriteBatch.End();

            base.Draw(gameTime);
        }
Example #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.CornflowerBlue);

            // STUDENTS: draw rocks
            spriteBatch.Begin();
            spriteBatch.Draw(background3, new Rectangle(0, 0, 800, 600), Color.White);
            if (rock0 != null)
            {
                rock0.Draw(spriteBatch);
            }
            if (rock1 != null)
            {
                rock1.Draw(spriteBatch);
            }
            if (rock2 != null)
            {
                rock2.Draw(spriteBatch);
            }
            spriteBatch.End();

            base.Draw(gameTime);
        }