Ejemplo n.º 1
0
        public override void Draw(GameTime gameTime)
        {
            bloom.BeginDraw();
            batch = ScreenManager.SpriteBatch;
            ScreenManager.GraphicsDevice.Clear(Color.Black);
            batch.Begin();


            batch.Draw(tex, new Vector2(512, 384), null, Color.White, 0f, new Vector2(tex.Width / 2, tex.Height / 2), 1f, SpriteEffects.None, 1f);
            UI.Draw(batch);

            batch.End();


            // If the game is transitioning on or off, fade it out to black.
            if (TransitionPosition > 0 || pauseAlpha > 0)
            {
                float alpha = MathHelper.Lerp(1f - TransitionAlpha, 1f, pauseAlpha / 2);

                ScreenManager.FadeBackBufferToBlack(alpha);
            }
            base.Draw(gameTime);
        }
Ejemplo n.º 2
0
        // <summary>
        /// Draws the gameplay screen.
        /// </summary>
        public override void Draw(GameTime gameTime)
        {
            bloom.BeginDraw();

            ScreenManager.GraphicsDevice.Clear(ClearOptions.Target,
                                               Color.Black, 0, 0);

            SpriteBatch spriteBatch = ScreenManager.SpriteBatch;

            spriteBatch.Begin(SpriteSortMode.FrontToBack,
                              BlendState.AlphaBlend,
                              null,
                              null,
                              null,
                              null,
                              cam2D.View);
            foreach (SeekerDrone drone in Drones)
            {
                drone.draw(spriteBatch);
            }

            foreach (Square square in Squares)
            {
                square.Draw(spriteBatch);
                if (square.isTouching)
                {
                }
            }
            foreach (Area area in Areas)
            {
                area.Draw(spriteBatch);
            }
            foreach (Wall wall in Walls)
            {
                wall.Draw(spriteBatch);
            }
            foreach (Pickupable pickupable in pickuables)
            {
                pickupable.Draw(spriteBatch);
            }

            if ((!GamePad.GetState(PlayerIndex.One).IsConnected) && playerBody.getSetLaserStatus)
            {
                Vector2 mousePos = new Vector2(mouse.X, mouse.Y);
                spriteBatch.Draw(reticle, mousePos + cam2D.Position - new Vector2(1024 / 2, 768 / 2), null, Color.White, 0f, new Vector2(10, 10), 1f, SpriteEffects.None, 1f);
            }


            playerBody.draw(spriteBatch);



            spriteBatch.End();

            spriteBatch.Begin();

            UI.Draw(spriteBatch);
            spriteBatch.End();


            // If the game is transitioning on or off, fade it out to black.
            if (TransitionPosition > 0 || pauseAlpha > 0)
            {
                float alpha = MathHelper.Lerp(1f - TransitionAlpha, 1f, pauseAlpha / 2);

                ScreenManager.FadeBackBufferToBlack(alpha);
            }
        }