Example #1
0
        //TODO Remove magic numbers
        private WeaponModuleUnit CreateWeaponModuleUnitHorizontal(
            float frequency,
            float damage,
            float projectileSpeed,
            SKPoint coords,
            SKSize projSize,
            SKSize explSize,
            float cooldownPhaseShiftPercent = 0
            )
        {
            //TODO fix 1ms execution time
            Helper.StartTimeLog("CreateWeaponModHoriz");
            MovementModule module =
                movementModuleFactory.CreateHorizontalModule(
                    coords,
                    projSize,
                    explSize,
                    projectileSpeed
                    );
            WeaponModuleUnit unit = new WeaponModuleUnit(
                frequency,
                damage,
                module,
                projBitmap,
                animatorExpl1
                );

            unit.SetCooldownPhaseShiftPercent(cooldownPhaseShiftPercent);
            Helper.FinishTimeLog("CreateWeaponModHoriz");
            return(unit);
        }
Example #2
0
        public WeaponModule CreateEnemyWeaponFanShot(
            float frequency,
            float damage,
            float projectileSpeed,
            float rotAngleMin,
            float rotAngleMax,
            float rotCycleDuration
            )
        {
            WeaponModule     module = new WeaponModule();
            WeaponModuleUnit unit   = CreateWeaponModuleUnitHorizontal(
                frequency,
                damage,
                projectileSpeed,
                new SKPoint(0, Settings.Enemy2.Weapon.yCoords),
                new SKSize(
                    Settings.WeaponFanShot.projSizeX,
                    Settings.WeaponFanShot.projSizeY
                    ),
                new SKSize(
                    Settings.WeaponFanShot.explSizeX,
                    Settings.WeaponFanShot.explSizeY
                    )
                );

            unit.SetRotating(rotAngleMin, rotAngleMax, rotCycleDuration);
            module.AddWeaponUnit(unit);
            return(module);
        }
Example #3
0
 public void AddWeaponUnit(WeaponModuleUnit unit)
 {
     unit.friendly = friendly;
     weaponUnits.Add(unit);
 }