예제 #1
0
파일: Weapon.cs 프로젝트: trew/PoorJetX
 public Weapon(IPoorWeaponHolder owner)
     : base("")
 {
     _owner = owner;
     _reloadTimer = new Stopwatch();
     _reloadTimer.Start();
 }
예제 #2
0
 public BombProjectile(Vector2 pos, Vector2 velocity, IPoorWeaponHolder origin)
     : base("bomb2", pos, velocity, origin)
 {
     Scale = new Vector2(0.13f, 0.13f);
     _invulnerableTime = 1.0f;
     _soundFX_id = SoundFxManager.AddInstance(SoundFxLibrary.GenerateInstance("bombwhistle"));
     SoundFxManager.GetByID(_soundFX_id).IsLooped = true;
     Damage = 10000;
 }
예제 #3
0
        public CannonProjectile(Vector2 pos, Vector2 velocity, float orientation, IPoorWeaponHolder origin)
            : base("bullet", pos, velocity, origin)
        {
            _orientation = orientation;
            float xFactor = (float)Math.Sin(CalcHelper.DegreeToRadian(_orientation));
            float yFactor = (float)-Math.Cos(CalcHelper.DegreeToRadian(_orientation));
            Vector2 boostFactor = new Vector2(xFactor*4, yFactor*4);

            _velocity = velocity + boostFactor;
            _invulnerableTime = 0.8f;
            Damage = 100;
        }
예제 #4
0
파일: Projectile.cs 프로젝트: trew/PoorJetX
        public Projectile(string texture, Vector2 pos, Vector2 velocity, IPoorWeaponHolder origin)
            : base(texture)
        {
            Position = pos;
            _velocity = velocity;
            _orientation = 0f;

            Z = 1.5f;
            SpawnTime = 0.0;
            UsedInBoundingBoxCheck = true;
            _originator = origin;
            _invulnerableTime = 0;
        }
예제 #5
0
        public BulletProjectile(Vector2 pos, Vector2 velocity, float velocityBoost, float orientation, float spreadDegrees, IPoorWeaponHolder origin)
            : base("bullet", pos, velocity, origin)
        {
            Random rnd = new Random(Guid.NewGuid().GetHashCode());
            _spread = (rnd.NextDouble() * spreadDegrees) / 2.0;

            if (rnd.NextDouble() > 0.5)
            {
                _spread = -_spread;
            }
            _orientation = orientation + (float)_spread;
            float xFactor = (float)Math.Sin(CalcHelper.DegreeToRadian(_orientation));
            float yFactor = (float)-Math.Cos(CalcHelper.DegreeToRadian(_orientation));
            Vector2 boostFactor = new Vector2(xFactor * velocityBoost, yFactor * velocityBoost);

            _velocity = velocity + boostFactor;
            _invulnerableTime = 0.5f;
            Damage = 200;
        }
예제 #6
0
        public AntiAirCannon(IPoorWeaponHolder owner)
            : base(owner)
        {
            firstBurst = true;
            bulletsThisBurst = 0;
            _burstTimer = new Stopwatch();
            _burstTimer.Start();

            _muzzleFlashBig = new MuzzleFlashBig(EngineManager.Game, 4);
            EngineManager.Game.Components.Add(_muzzleFlashBig);
            _muzzleFlash = new MuzzleFlash(EngineManager.Game, 4);
            EngineManager.Game.Components.Add(_muzzleFlash);

            setGunLength(45f);

            /*
            gunOffset = new Vector2[4];
            gunOffset[0] = new Vector2(0, -3);
            gunOffset[1] = new Vector2(-3, 0);
            gunOffset[2] = new Vector2(-6, 3);
            gunOffset[3] = new Vector2(3, -6);
            GunLength = 45f;
            */
        }
예제 #7
0
파일: Cannon.cs 프로젝트: trew/PoorJetX
 public Cannon(IPoorWeaponHolder owner)
     : base(owner)
 {
 }
예제 #8
0
파일: BombWeapon.cs 프로젝트: trew/PoorJetX
 public BombWeapon(IPoorWeaponHolder owner)
     : base(owner)
 {
 }
예제 #9
0
 public ProjectileWeapon(IPoorWeaponHolder owner)
     : base(owner)
 {
     _muzzleFlash = new MuzzleFlashSmall(EngineManager.Game, 4);
     EngineManager.Game.Components.Add(_muzzleFlash);
 }