Exemplo n.º 1
0
        public PlayerHealth(ContentManager Content)
        {
            health = new Health(Content);
            health.healthBarSprite = new Sprite(Content, SpritePath,
                                                Units.GameToPixel(HealthBarSourceX), Units.GameToPixel(HealthBarSourceY),
                                                Units.GameToPixel(HealthBarSourceWidth), Units.GameToPixel(HealthBarSourceHeight));

            health.healthFillSprite = new VaryingWidthSprite(Content, SpritePath,
                                                             Units.GameToPixel(HealthFillSourceX), Units.GameToPixel(HealthFillSourceY),
                                                             Units.GameToPixel(MaxFillWidth), Units.GameToPixel(MaxFillWidth),
                                                             Units.GameToPixel(HealthFillSourceHeight));

            health.damageFillSprite = new VaryingWidthSprite(Content, SpritePath,
                                                             Units.GameToPixel(HealthDamageSourceX), Units.GameToPixel(HealthDamageSourceY),
                                                             Units.GameToPixel(MaxFillWidth), Units.GameToPixel(0),
                                                             Units.GameToPixel(HealthDamageSourceHeight));
            health.healthNumberSprite = NumberSprite.HudNumber(Content, 0, HealthNumberNumDigits);
        }
Exemplo n.º 2
0
 public GunExperienceHud(ContentManager Content)
 {
     experienceBarSprite = new Sprite(Content, SpriteName,
                                      Units.GameToPixel(ExperienceBarSourceX), Units.GameToPixel(ExperienceBarSourceY),
                                      Units.GameToPixel(ExperienceBarSourceWidth), Units.GameToPixel(ExperienceBarSourceHeight));
     levelSprite = new Sprite(Content, SpriteName,
                              Units.TileToPixel(LevelSourceX), Units.GameToPixel(LevelSourceY),
                              Units.TileToPixel(LevelSourceWidth), Units.GameToPixel(LevelSourceHeight));
     flashSprite = new Sprite(Content, SpriteName,
                              Units.GameToPixel(FlashSourceX), Units.TileToPixel(FlashSourceY),
                              Units.GameToPixel(ExperienceBarSourceWidth), Units.GameToPixel(ExperienceBarSourceHeight));
     fillSprite = new VaryingWidthSprite(Content, SpriteName,
                                         Units.TileToPixel(FillSourceX), Units.TileToPixel(FillSourceY),
                                         Units.GameToPixel(ExperienceBarSourceWidth), 0,
                                         Units.GameToPixel(ExperienceBarSourceHeight));
     maxSprite = new Sprite(Content, SpriteName,
                            Units.GameToPixel(MaxSourceX), Units.GameToPixel(MaxSourceY),
                            Units.GameToPixel(ExperienceBarSourceWidth), Units.GameToPixel(ExperienceBarSourceHeight));
     flashTimer = new Timer(FlashTime);
     number     = NumberSprite.HudNumber(Content, 0, 2);
 }