private void Initialize()
        {
            Position = Vector3.Zero;
            Velocity = Vector3.Zero;

            HitPoints = 10;
            Score     = 0;
            Speed     = 5;

            ShotSoundInstance     = ShotSound.CreateInstance();
            HealthUpSoundInstance = HealthUpSound.CreateInstance();
        }
 private void BulletShoot()
 {
     lock (Sprite)
     {
         ShotSound.Play();
         BulletCounter++;
         var bullet = new Bullet {
             Shape = { Position = Center }
         };
         bullet.CurrentVelocity = AimDirectionNormal * bullet.MaxVelocity;
         Bullets.Add(bullet);
     }
 }
Exemple #3
0
        public WeaponSerializable Serialize()
        {
            var serializable = new WeaponSerializable();

            serializable.Id                = ItemId.Id;
            serializable.FileName          = ItemId.Name;
            serializable.ItemType          = (int)ItemType.Weapon;
            serializable.WeaponClass       = WeaponClass;
            serializable.FireRate          = FireRate.Value;
            serializable.Spread            = Spread.Value;
            serializable.Magazine          = Magazine.Value;
            serializable.ActivationType    = ActivationType;
            serializable.ShotSound         = ShotSound.ToString();
            serializable.ChargeSound       = ChargeSound.ToString();
            serializable.ShotEffectPrefab  = ShotEffectPrefab;
            serializable.ControlButtonIcon = ControlButtonIcon;
            return(serializable);
        }