Пример #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);
        }
Пример #2
0
        //TODO Make Create Enemy prettier
        public Enemy CreateEnemy1(SKPoint coords)
        {
            Enemy enemy = new Enemy(
                Settings.Enemy1.health,
                movementModuleFactory.CreateHorizontalModule(
                    coords,
                    new SKSize(Settings.Enemy1.sizeX, Settings.Enemy1.sizeY),
                    new SKSize(Settings.Enemy1.explSizeX, Settings.Enemy1.explSizeY),
                    Settings.Enemy1.speed,
                    Settings.Enemy2.xCoordLimit
                    ),
                weaponModuleFactory.CreateEnemyWeaponFourShot(
                    Settings.Enemy1.Weapon.frequency,
                    Settings.Enemy1.Weapon.damage,
                    Settings.Enemy1.Weapon.projSpeed
                    ),
                enemy1NormalAnim,
                enemy1ExplAnim
                );

            return(enemy);
        }