Example #1
0
    void Start()
    {
        Lion butcher = new Lion();

        butcher.Power = 5;
        Gazelle nextMeal = new Gazelle();

        butcher.Attack(nextMeal);
    }
Example #2
0
        private void _populate()
        {
            FillObstaclesWithArray(GetFunPlayField());
            graph = GraphGenerator.FloodFill(world: this, startPosition: new Vector2D(50f, 50f));
            GraphGenerator.SetNearestItems(this);

            Lion l1 = new Lion(new Vector2D(60f, 60f), this);
            Lion l2 = new Lion(new Vector2D(120, 100f), this);

            Gazelle g1 = new Gazelle(new Vector2D(200f, 200f), this);
            Gazelle g2 = new Gazelle(new Vector2D(250f, 250f), this);
            Gazelle g3 = new Gazelle(new Vector2D(300f, 300f), this);

            Entities.AddRange(new List <MovingEntity>()
            {
                g1,
                l1,
                g2,
                g3,
                l2
            });
        }
Example #3
0
 public void Attack(Gazelle gazelle)
 {
     gazelle.ReceiveDamage(Power);
 }
Example #4
0
 public GoalCatchGazelle(MovingEntity owner, Gazelle prey) : base(owner, "CatchGazelle")
 {
     _prey = prey;
 }