Ejemplo n.º 1
0
 public Chicken(ILevelManager level, IUnit unit, ChickenType type)
     : base(level, unit)
 {
     this.myType         = type;
     this.AttackMove     = false;
     unit.AlwaysVertical = true;
     distCalc            = new ChickenDistCalc(this, 1, 1, 1);
 }
Ejemplo n.º 2
0
        public static Chicken CreateNew(ILevelManager level, IUnit unit, ChickenType type)
        {
            Chicken newChicken = new Chicken(level, unit, type);

            newChicken.animationController = unit.CreateComponent <AnimationController>();
            newChicken.Walker  = WorldWalker.CreateNew(newChicken, level);
            newChicken.Shooter = Shooter.CreateNew(newChicken, level, type.ProjectileType, new Vector3(0, 0.7f, -0.7f), 20);
            newChicken.Shooter.SearchForTarget   = true;
            newChicken.Shooter.TargetSearchDelay = 2;
            newChicken.healthBar = new HealthBarControl(level, unit, 100, new Vector3(0, 15, 0), new Vector2(0.5f, 0.1f), true);

            var selector = UnitSelector.CreateNew(newChicken, level);

            MovingRangeTarget.CreateNew(newChicken, level, new Vector3(0, 0.5f, 0));

            newChicken.RegisterEvents(newChicken.Walker, newChicken.Shooter, selector);

            return(newChicken);
        }
Ejemplo n.º 3
0
 public ChickenSpawner(GameController input, GameUI ui, CameraMover camera, UnitType type, ChickenType myType)
     : base(input, ui, camera, type)
 {
     this.myType = myType;
 }
Ejemplo n.º 4
0
 public static Chicken CreateForLoading(ILevelManager level, IUnit unit, ChickenType type)
 {
     return(new Chicken(level, unit, type));
 }