Exemple #1
0
        //attack method
        public void attack(dino dinoBeingAttacked)

        {
            // lower the 'health'
            dinoBeingAttacked.health -= 10;

            powerlevel--;
            dino health--;
            dino attackPower--;

            string DinoAttack  = 5;
            dino   attackPower = 10;
            dino   energy      = 2;
            dino   health      = 3;
        }
Exemple #2
0
        public void Populateherd()
        {
            //instantiate three robot objects
            //for loop or just create them on three separate lines
            //list add method

            //when instantiating a new object:
            //assign values to your robot member variables
            dino newdino1 = new dino();
            dino newdino2 = new dino();
            dino newdino3 = new dino();

            herdtFleet.Add(newdino1);
            herdtFleet.Add(newdino2);
            herdtFleet.Add(newdino3);
        }