Ejemplo n.º 1
0
        public static void Draw()
        {
            var spriteBatch = VariableProvider.SpriteBatch;

            Entities.ForEach(e => e.Draw());
            _player.Draw();
        }
Ejemplo n.º 2
0
        public void Draw()
        {
            if (m_CurrentState == null)
            {
                return;
            }

            m_CurrentState.Draw();
        }
 public virtual void Draw(SpriteBatch spriteBatch)
 {
     // Draw is required as part of the IGameObject interface. Everything must implement this interface.
     for (int i = 0; i < components.Count; i++)
     {
         IGameObject component = components[i] as IGameObject;
         component.Draw(spriteBatch);
     }
 }
Ejemplo n.º 4
0
 public void Draw(SpriteBatch spriteBatch)
 {
     if (counter < TimerUtil.DisplayTimer)
     {
         backgroundObject.Draw(spriteBatch);
         lifeTextSprite.Location = new Vector2(SpriteUtil.textPositionX, SpriteUtil.textPositionY);
         lifeTextSprite.Draw(spriteBatch);
         marioSprite.Draw(spriteBatch, new Vector2(SpriteUtil.marioPositionX, SpriteUtil.marioPositionY));
     }
 }
 public void Draw(SpriteBatch spriteBatch)
 {
     // Call Draw on every entity on the list
     for (int i = 0; i < Entities.Count; i++)
     {
         // Draw is a method in the IGameObject interface, not IEntity.
         // So a cast is required before it can be called.
         IGameObject entity = Entities[i] as IGameObject;
         entity.Draw(spriteBatch);
     }
 }
Ejemplo n.º 6
0
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.Black);

            spriteBatch.Begin(samplerState: SamplerState.PointClamp);

            gameObject.Draw(spriteBatch);

            foreach (ITextSprite text in texts)
            {
                text.Draw(spriteBatch);
            }

            spriteBatch.End();

            base.Draw(gameTime);
        }
Ejemplo n.º 7
0
        public override void Draw(SpriteBatch spriteBatch)
        {
            // Draw game BG between Dark and Normal mode
            spriteBatch.Draw(GodMode ? BG_Dark : BG_Normal, Vector2.Zero, Color.White);

            if (GodMode)
            {
                NightObj.ForEach(obj => obj.Draw(spriteBatch));
            }
            else
            {
                LightObj.ForEach(obj => obj.Draw(spriteBatch));
            }

            spriteBatch.DrawString(font, "Time : " + time.ToString("0.00"), new Vector2(25, 25), Color.Black);

            spriteBatch.Draw(catapultBackTexture, new Vector2(200, 470), Color.White);
            BulletObj.Draw(spriteBatch);
            spriteBatch.Draw(catapultFrontTexture, new Vector2(200, 470), Color.White);

            if (isWin)
            {
                spriteBatch.Draw(BlackPanel, Vector2.Zero, new Color(Color.Black, 0.8f));
                if (star == 1)
                {
                    spriteBatch.Draw(Star1, new Vector2(640 - Star1.Width / 2, 360 - Star1.Height), Color.White);
                }
                else if (star == 2)
                {
                    spriteBatch.Draw(Star2, new Vector2(640 - Star1.Width / 2, 360 - Star1.Height), Color.White);
                }
                else if (star == 3)
                {
                    spriteBatch.Draw(Star3, new Vector2(640 - Star1.Width / 2, 360 - Star1.Height), Color.White);
                }
                spriteBatch.Draw(Restart, new Vector2(100, 500), Color.White);
                spriteBatch.Draw(Home, new Vector2(450, 500), Color.White);
                spriteBatch.Draw(Next, new Vector2(800, 500), Color.White);
            }
        }
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);

            // TODO: Add your drawing code here
            _spriteBatch.Begin();

            hero.Draw(_spriteBatch);

            foreach (IMapObject block in blocks)
            {
                block.Draw(_spriteBatch);
            }

            // DRAW COLLIDERS
            //collisionManager.DrawColliders(_spriteBatch, GraphicsDevice);

            _spriteBatch.End();


            base.Draw(gameTime);
        }
Ejemplo n.º 9
0
 protected override void Draw(GameTime gameTime)
 {
     GraphicsDevice.Clear(Color.CornflowerBlue);
     mario.Draw(spriteBatch);
     obj2.Draw(spriteBatch);
 }
Ejemplo n.º 10
0
 public void Draw(SpriteBatch spriteBatch)
 {
     backgroundSprite.Draw(spriteBatch);
     lifeTextSprite.Location = new Vector2(SpriteUtil.gameOverPositionX, SpriteUtil.gameOverPositionY);
     lifeTextSprite.Draw(spriteBatch);
 }