Exemplo n.º 1
0
 public void Play(SoundsName sound)
 {
     if (playEffects)
     {
         try
         {
             sounds[(int)sound].Play();
         }
         catch (Exception)
         {
         }
     }
 }
Exemplo n.º 2
0
        public Weapon(int prix, string ammo, string image, int damage, double cadence, cadenceType cadenceType, int munitions, int currentAmo, int capacity, int accuracy, int range, Vector2 position, Vector2 speed, string weaponName, bool isOnMap, int id, ContentManager Content, SoundsName Sound, tirTypes tirtypes, bool hasSpecialAttack, int numBalle, int numArme)

            : base(TexturesGame.weaponTab[numArme], position, speed, isOnMap, Direction.right, new Vector2(0, 0), objectType.weapon, id)
        {
            this.shotSound        = Sound;
            this.tirtype          = tirtypes;
            this.hasSpecialAttack = hasSpecialAttack;
            this.prix             = prix;
            specialAttackEnabled  = false;
            this.ammo             = ammo;
            ammoTexture           = Tools.LoadTexture(ammo, Content);
            imagename             = image;
            name            = weaponName;
            this.damage     = damage;
            this.isOnMap    = true;
            this.cadence    = cadence;
            this.weaponType = cadenceType;
            this.accuracy   = accuracy;
            this.range      = range;
            this.munitions  = munitions;
            this.weaponName = weaponName;
            this.angle      = 0;
            autoTirs        = 0;
            this.currentAmo = currentAmo;
            this.capacity   = capacity;
            this.count2     = 0;
            scopeTexture    = Tools.LoadTexture("SpriteTexture/Others/Scope", Content);

            weaponSprite  = Tools.LoadTexture("Weapons/WeaponSprite/" + weaponName, Content);
            this.numArme  = numArme;
            this.numBalle = numBalle;

            rafalstirs = 0;

            if (weaponName == "FlameThrower")
            {
                nTexture = 1;
            }
            else
            {
                nTexture = 0;
            }
        }