Exemple #1
0
        private void DrawWeaponsEnabled(Camera camera)
        {
            Vector2 basepoint = WEAPONS_ENABLED_BASEPOINT;
            float   width     = smallWeaponIconsTextureSheet.CellSourceRectangles[0].Width;

            foreach (HUDWeaponInfo weaponInfo in WeaponsEnabled)
            {
                smallWeaponIconsTextureSheet.DrawCellAtIndex(camera, basepoint, weaponInfo.IconCellIndex);
                switch (weaponInfo.Type)
                {
                case HUDWeaponType.Gasoline:
                    Vector2 textLocation = new Vector2(basepoint.X + (width / 2.0f), basepoint.Y - 16.0f);
                    Fonts.DrawTextTopCenterAligned("DebugSpriteFont", Game.SurvivorSubsystem.PlayerOneSurvivorSprite.Ammunition.GasolineTotal.ToString("F0"), camera.SpriteBatch, textLocation, Color.White);
                    break;

                case HUDWeaponType.Pistol:
                    textLocation = new Vector2(basepoint.X + (width / 2.0f), basepoint.Y - 16.0f);
                    Fonts.DrawTextTopCenterAligned("DebugSpriteFont", Game.SurvivorSubsystem.PlayerOneSurvivorSprite.Ammunition.PistolRoundsTotal.ToString("F0"), camera.SpriteBatch, textLocation, Color.White);
                    break;

                case HUDWeaponType.Shotgun:
                    textLocation = new Vector2(basepoint.X + (width / 2.0f), basepoint.Y - 16.0f);
                    Fonts.DrawTextTopCenterAligned("DebugSpriteFont", Game.SurvivorSubsystem.PlayerOneSurvivorSprite.Ammunition.ShotgunShellsTotal.ToString("F0"), camera.SpriteBatch, textLocation, Color.White);
                    break;

                default:
                    break;
                }
                basepoint.X += width;
            }
        }
Exemple #2
0
        private void DrawWeaponsStatusArea(Camera camera)
        {
            DrawWeaponsEnabled(camera);
            weaponIconsTextureSheet.DrawCellAtIndex(camera, WEAPON_ICON_POSITION, WeaponInfo.IconCellIndex);
            switch (WeaponInfo.Type)
            {
            case HUDWeaponType.Gasoline:
                Fonts.DrawTextTopRightAligned("MediumLEDSpriteFont", Game.SurvivorSubsystem.PlayerOneSurvivorSprite.Ammunition.GasolineCans.ToString("F0"), camera.SpriteBatch, WEAPON_CLIPS_POSITION, Color.White);
                Fonts.DrawTextTopRightAligned("MediumLEDSpriteFont", Game.SurvivorSubsystem.PlayerOneSurvivorSprite.Ammunition.GasolineInCurrentCan.ToString("F0"), camera.SpriteBatch, WEAPON_ROUNDS_POSITION, Color.White);
                break;

            case HUDWeaponType.Pistol:
                Fonts.DrawTextTopRightAligned("MediumLEDSpriteFont", Game.SurvivorSubsystem.PlayerOneSurvivorSprite.Ammunition.PistolClips.ToString("F0"), camera.SpriteBatch, WEAPON_CLIPS_POSITION, Color.White);
                Fonts.DrawTextTopRightAligned("MediumLEDSpriteFont", Game.SurvivorSubsystem.PlayerOneSurvivorSprite.Ammunition.PistolRoundsInCurrentClip.ToString("F0"), camera.SpriteBatch, WEAPON_ROUNDS_POSITION, Color.White);
                break;

            case HUDWeaponType.Shotgun:
                Fonts.DrawTextTopRightAligned("MediumLEDSpriteFont", Game.SurvivorSubsystem.PlayerOneSurvivorSprite.Ammunition.ShotgunShellsInBandolier.ToString("F0"), camera.SpriteBatch, WEAPON_CLIPS_POSITION, Color.White);
                Fonts.DrawTextTopRightAligned("MediumLEDSpriteFont", Game.SurvivorSubsystem.PlayerOneSurvivorSprite.Ammunition.ShotgunShellsInMagazine.ToString("F0"), camera.SpriteBatch, WEAPON_ROUNDS_POSITION, Color.White);
                break;

            default:
                break;
            }
        }
 public override void Draw(GameTime gameTime, Camera camera)
 {
     if (this.Alive)
     {
         zombieDrawTextureSheet.DrawCellAtIndex(camera, Location, currentCellIndex);
         //zombieDefenseTextureSheet.DrawCellAtIndex(camera, Location, currentCellIndex);
     }
 }
        public void Draw(GameTime gameTime, Camera camera)
        {
            switch (collectableEntityType)
            {
            case CollectableEntityType.Gasoline: gasolineCollectableTextureSheet.DrawCellAtIndex(camera, Location, 0); break;

            case CollectableEntityType.Health: healthCollectableTextureSheet.DrawCellAtIndex(camera, Location, 0); break;

            case CollectableEntityType.PistolAmmo: pistolAmmoCollectableTextureSheet.DrawCellAtIndex(camera, Location, 0); break;

            case CollectableEntityType.ShotgunAmmo: shotgunAmmoCollectableTextureSheet.DrawCellAtIndex(camera, Location, 0); break;

            case CollectableEntityType.Energy: energyCollectableTextureSheet.DrawCellAtIndex(camera, Location, 0); break;

            default: break;
            }
        }
 public override void Draw(GameTime gameTime, Camera camera)
 {
     survivorDrawTextureSheet.DrawCellAtIndex(camera, Location, CurrentCellIndex);
     //ShotgunWeapon.shotgunAttackTextureSheet.DrawCellAtIndex(camera, Location, 0);
 }