Exemple #1
0
 public Camera(Creature focus, int width, int height, Map nMap)
 {
     this.focus = focus;
     this.width = width;
     this.height = height;
     this.map = nMap;
     origin = new Coord(width / 2, height / 2);
     visiblePositions = new bool[width, height];
 }
Exemple #2
0
 public override void Attack(Creature aEnemy)
 {
     Trace.WriteLine("Player has attacked " + aEnemy.Name);
     //for now, make it simple
     int damage = Strength;
     //get damage based on weapon
        damage += ((Weapon)(((Player)this).EquipmentIn(EquipmentTypes.MELEE_WEAPON))).Damage;
        Trace.WriteLine("Player attacks zombie with " + EquipmentIn(EquipmentTypes.MELEE_WEAPON).Name +
             " for " + damage + " damage");
        aEnemy.Health -= damage;
     if (aEnemy.Health <= 0)
     {
         aEnemy.Die();
         //if it's a gun, make a NoiseEvent
         //EventHandler.Instance.AddEvent(EventFactory.CreateKillEntityEvent(aEnemy));
     }
 }
Exemple #3
0
 public virtual void Attack(Creature aDefender)
 {
 }
Exemple #4
0
 public void RemoveObject(Creature aCreature)
 {
     MapEntities.Remove(aCreature);
     RemoveObject((GameObject)aCreature);
 }