Пример #1
0
        public void Update(Viking viking)
        {
            //TODO resize current health box
            fullHealth.Width    = 2 * viking.getFullHealth();
            currentHealth.Width = 2 * viking.getHealth();
            fullhealth          = viking.getFullHealth();

            //testiColour.Width -= 62/25;
            //testiColour2.Width -= 62/25;

            cLevel = viking.getLevel();
            if (health > viking.getHealth())
            {
                health -= 1;
            }
            if (health < viking.getHealth())
            {
                health += 1;
            }
        }
Пример #2
0
        public void Initialize(GraphicsDevice g, Viking viking)
        {
            //TODO set fullhealth at startup
            fullHealth    = new Rectangle(10, 10, 200, 20);
            currentHealth = new Rectangle(10, 10, 200, 20);

            healthBarLocationRectangle = new Rectangle(20, 40, 342, 138);
            testiColour  = new Rectangle(0, 0, 62, 138);
            testiColour2 = new Rectangle(122, 40, 62, 138);

            pixel = new Texture2D(g, 1, 1);
            pixel.SetData <Color>(new Color[] { Color.White });
            health = viking.getHealth();
        }