예제 #1
0
        public override void Draw(World world, XnaGraphics graphics)
        {
            this.m_World = world as RedMeansGoWorld;
            base.Draw(world, graphics);

            graphics.DrawSprite((int)this.X, (int)this.Y, this.Width - 8, this.Height - 8, "player.powerup", this.PowerupColor, false, this.Rotation,
                                new Vector2(54 / 2, 54 / 2));

            string msg;
            if (this.Health <= 0)
                msg = "You win.  They died.";
            else
                msg = "Distance to Heart: " + (this.Health * 150).ToString("F2") + "cm";
            graphics.DrawStringCentered((int)this.X, (int)this.Y + 40, msg);
            RedMeansGoGame.SetWindowTitle(msg);
        }
예제 #2
0
        public override void Draw(World world, XnaGraphics graphics)
        {
            base.Draw(world, graphics);

            if (this.Width == 16 && this.CurrentHealth > 0 && this.MaxHealth > 0)
                graphics.DrawSprite((int)this.X, (int)this.Y, this.Width, this.Height, "meters.health.i" + ((int)(16 - (this.CurrentHealth / this.MaxHealth * 15))).ToString(), Color.White, false);

            // You can override to show more meters in subclasses.
        }