Ejemplo n.º 1
0
        public void Draw(SpriteBatch spriteBatch, Vector2 MovingPosition)
        {
            Background.Draw(Texture2DStorage.GetInventoryBackgroundSpriteSheet(), spriteBatch, Backgroundposition + MovingPosition);

            if (MovingPosition == new Vector2(0, 0))
            {
                Selection.Draw(Texture2DStorage.GetRedSelectionSpriteSheet(), spriteBatch, SelectionPosition);

                if (game.Link.HasMap)
                {
                    MapSprite.Draw(Texture2DStorage.GetMapSpriteSheet(), spriteBatch, SmallMapPosition);
                    //MapPositionSprite.Draw();
                    //LinkPositionSprite.Draw();
                }

                if (game.Link.BombNumber > 0)
                {
                    BombSprite.Draw(Texture2DStorage.GetBombSelectSpriteSheet(), spriteBatch, BombPosition);
                }

                if (game.Link.HasBow)
                {
                    BowSprite.Draw(Texture2DStorage.GetBowSpriteSheet(), spriteBatch, bowPosition);
                }
                if (game.Link.HasCompass)
                {
                    CompassSprite.Draw(Texture2DStorage.GetCompassSpriteSheet(), spriteBatch, CompassPosition);
                }
                if (game.Link.HasBoomer)
                {
                    BoomerSprite.Draw(Texture2DStorage.GetBoomerSelectSpriteSheet(), spriteBatch, BoomerPosition);
                }

                if (selectedItem == BombSprite)
                {
                    BombSprite.Draw(Texture2DStorage.GetBombSpriteSheet(), spriteBatch, SelectItemPosition);
                }
                else if (selectedItem == BowSprite)
                {
                    BowSprite.Draw(Texture2DStorage.GetBowSpriteSheet(), spriteBatch, SelectItemPosition);
                }
                else if (selectedItem == BoomerSprite)
                {
                    BoomerSprite.Draw(Texture2DStorage.GetBoomerangSpriteSheet(), spriteBatch, SelectItemPosition);
                }
            }
        }
Ejemplo n.º 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);

            spriteBatch.Begin();

            this.dungeonlevel.Draw(spriteBatch);
            Link.State.Draw(spriteBatch);
            this.ProjectileFactory.Draw(spriteBatch);
            headSprite.Draw(Texture2DStorage.HeadExteriorSpriteSheet, spriteBatch, new Vector2(0, 1056));



            if (Link.HeartContainer < 8)
            {
                for (int i = 0; i < Link.HeartContainer; i++)
                {
                    EmptyBloodHeartSprite.Draw(Texture2DStorage.GetHeartNoBloodSpriteSheet(), spriteBatch, new Vector2(1056 + 48 * i, 1248));
                }
            }
            else
            {
                for (int k = 0; k < 8; k++)
                {
                    EmptyBloodHeartSprite.Draw(Texture2DStorage.GetHeartNoBloodSpriteSheet(), spriteBatch, new Vector2(1056 + 48 * k, 1248));
                }
                for (int j = 0; j < Link.HeartContainer - 8; j++)
                {
                    EmptyBloodHeartSprite.Draw(Texture2DStorage.GetHeartNoBloodSpriteSheet(), spriteBatch, new Vector2(1056 + 48 * j, 1296));
                }
            }
            if (Link.Life < 16)
            {
                if (Link.Life % 2 == 0)
                {
                    for (int i = 0; i < Link.Life / 2; i++)
                    {
                        FullBloodHeartSprite.Draw(Texture2DStorage.GetHeartFullBloodSpriteSheet(), spriteBatch, new Vector2(1056 + 48 * i, 1248));
                    }
                }
                else
                {
                    for (int i = 0; i < Link.Life / 2; i++)
                    {
                        FullBloodHeartSprite.Draw(Texture2DStorage.GetHeartFullBloodSpriteSheet(), spriteBatch, new Vector2(1056 + 48 * i, 1248));
                    }

                    HalfBloodHeartSprite.Draw(Texture2DStorage.GetHeartHalfBloodSpriteSheet(), spriteBatch, new Vector2(1056 + 48 * (Link.Life / 2), 1248));
                }
            }
            else
            {
                if (Link.Life % 2 == 0)
                {
                    for (int i = 0; i < 8; i++)
                    {
                        FullBloodHeartSprite.Draw(Texture2DStorage.GetHeartFullBloodSpriteSheet(), spriteBatch, new Vector2(1056 + 48 * i, 1248));
                    }
                    for (int j = 0; j < Link.Life / 2 - 8; j++)
                    {
                        FullBloodHeartSprite.Draw(Texture2DStorage.GetHeartFullBloodSpriteSheet(), spriteBatch, new Vector2(1056 + 48 * j, 1296));
                    }
                }
                else
                {
                    for (int i = 0; i < Link.Life / 2; i++)
                    {
                        FullBloodHeartSprite.Draw(Texture2DStorage.GetHeartFullBloodSpriteSheet(), spriteBatch, new Vector2(1056 + 48 * i, 1248));
                    }
                    for (int j = 0; j < Link.Life / 2 - 8; j++)
                    {
                        FullBloodHeartSprite.Draw(Texture2DStorage.GetHeartFullBloodSpriteSheet(), spriteBatch, new Vector2(1056 + 48 * j, 1296));
                    }


                    HalfBloodHeartSprite.Draw(Texture2DStorage.GetHeartHalfBloodSpriteSheet(), spriteBatch, new Vector2(1056 + 48 * ((Link.Life - 16) / 2), 1296));
                }
            }



            spriteBatch.DrawString(font, Link.RupeeNumber.ToString(), new Vector2(720, 1210), Color.White, 0, font.MeasureString(Link.RupeeNumber.ToString()), 3.0f, SpriteEffects.None, 1f);
            spriteBatch.DrawString(font, Link.KeyNumber.ToString(), new Vector2(720, 1310), Color.White, 0, font.MeasureString(Link.KeyNumber.ToString()), 3.0f, SpriteEffects.None, 1f);
            spriteBatch.DrawString(font, Link.BombNumber.ToString(), new Vector2(720, 1360), Color.White, 0, font.MeasureString(Link.BombNumber.ToString()), 3.0f, SpriteEffects.None, 1f);
            if (paused)
            {
                this.InventoryMenu.Draw(spriteBatch, new Vector2(0, 0));
            }
            if (Link.Life <= 0)
            {
                AudioFactory.Instance.StopDungeonBG();
                this.GameOver.Draw(spriteBatch);
            }
            if (Link.TriforceNumber > 0)
            {
                AudioFactory.Instance.StopDungeonBG();
                this.GameWin.Draw(spriteBatch);
            }
            spriteBatch.End();
            base.Draw(gameTime);
        }
Ejemplo n.º 3
0
        public void Draw()
        {
            headSprite.Draw(Texture2DStorage.HeadExteriorSpriteSheet, spriteBatch, new Vector2(0, 1056));
            int HeartContainer = 12;
            int life           = 19;

            if (HeartContainer < 8)
            {
                for (int i = 0; i < HeartContainer; i++)
                {
                    EmptyBloodHeartSprite.Draw(Texture2DStorage.GetHeartNoBloodSpriteSheet(), spriteBatch, new Vector2(1056 + 48 * i, 1248));
                }
            }
            else
            {
                for (int k = 0; k < 8; k++)
                {
                    EmptyBloodHeartSprite.Draw(Texture2DStorage.GetHeartNoBloodSpriteSheet(), spriteBatch, new Vector2(1056 + 48 * k, 1248));
                }
                for (int j = 0; j < HeartContainer - 8; j++)
                {
                    EmptyBloodHeartSprite.Draw(Texture2DStorage.GetHeartNoBloodSpriteSheet(), spriteBatch, new Vector2(1056 + 48 * j, 1296));
                }
            }
            if (life < 16)
            {
                if (life % 2 == 0)
                {
                    for (int i = 0; i < life / 2; i++)
                    {
                        FullBloodHeartSprite.Draw(Texture2DStorage.GetHeartFullBloodSpriteSheet(), spriteBatch, new Vector2(1056 + 48 * i, 1248));
                    }
                }
                else
                {
                    for (int i = 0; i < life / 2; i++)
                    {
                        FullBloodHeartSprite.Draw(Texture2DStorage.GetHeartFullBloodSpriteSheet(), spriteBatch, new Vector2(1056 + 48 * i, 1248));
                    }

                    HalfBloodHeartSprite.Draw(Texture2DStorage.GetHeartHalfBloodSpriteSheet(), spriteBatch, new Vector2(1056 + 48 * (life / 2), 1248));
                }
            }
            else
            {
                if (life % 2 == 0)
                {
                    for (int i = 0; i < 8; i++)
                    {
                        FullBloodHeartSprite.Draw(Texture2DStorage.GetHeartFullBloodSpriteSheet(), spriteBatch, new Vector2(1056 + 48 * i, 1248));
                    }
                    for (int j = 0; j < life / 2 - 8; j++)
                    {
                        FullBloodHeartSprite.Draw(Texture2DStorage.GetHeartFullBloodSpriteSheet(), spriteBatch, new Vector2(1056 + 48 * j, 1296));
                    }
                }
                else
                {
                    for (int i = 0; i < life / 2; i++)
                    {
                        FullBloodHeartSprite.Draw(Texture2DStorage.GetHeartFullBloodSpriteSheet(), spriteBatch, new Vector2(1056 + 48 * i, 1248));
                    }
                    for (int j = 0; j < life / 2 - 8; j++)
                    {
                        FullBloodHeartSprite.Draw(Texture2DStorage.GetHeartFullBloodSpriteSheet(), spriteBatch, new Vector2(1056 + 48 * j, 1296));
                    }


                    HalfBloodHeartSprite.Draw(Texture2DStorage.GetHeartHalfBloodSpriteSheet(), spriteBatch, new Vector2(1056 + 48 * ((life - 16) / 2), 1296));
                }
            }
            int bombscore  = 111;
            int keyscore   = 222;
            int rupeescore = 333;


            spriteBatch.DrawString(font, bombscore.ToString(), new Vector2(720, 1360), Color.White, 0, font.MeasureString(bombscore.ToString()), 3.0f, SpriteEffects.None, 1f);
            spriteBatch.DrawString(font, keyscore.ToString(), new Vector2(720, 1310), Color.White, 0, font.MeasureString(keyscore.ToString()), 3.0f, SpriteEffects.None, 1f);
            spriteBatch.DrawString(font, rupeescore.ToString(), new Vector2(720, 1210), Color.White, 0, font.MeasureString(rupeescore.ToString()), 3.0f, SpriteEffects.None, 1f);

            //     spriteBatch.DrawString(font, Link.RupeeNumber.ToString(), new Vector2(720, 1210), Color.White, 0, font.MeasureString(Link.RupeeNumber.ToString()), 3.0f, SpriteEffects.None, 1f);
            //   spriteBatch.DrawString(font, Link.KeyNumber.ToString(), new Vector2(720, 1310), Color.White, 0, font.MeasureString(Link.KeyNumber.ToString()), 3.0f, SpriteEffects.None, 1f);
            //  spriteBatch.DrawString(font, Link.BombNumber.ToString(), new Vector2(720, 1360), Color.White, 0, font.MeasureString(Link.BombNumber.ToString()), 3.0f, SpriteEffects.None, 1f);
        }