Ejemplo n.º 1
0
 public List<collisionBox> MoveCharacter(TDCharacter character)
 {
     if (character == character.leader)
     {
         List<collisionBox> collisionList = TestCollisions(character.collisionRect);
         if (collisionList == null)
         {
             character.Move(character.leader.speed);
         }
         else
         {
             //foreach (collisionBox cbox in collisionList) {
             for (int i=0; i < collisionList.Count; i++)
             {
                 collisionBox cbox = collisionList[i];
                 if (cbox.name.Equals("Wall"))
                 {
                     if (character.type == TDCharacterType.Hero)
                         character.ApplyDamage(TDCharacter.collisionDamage);
                     character.Move(-character.leader.speed);
                     character.CollisionTurn();
                     //this.MoveCharacter(character);
                 }
             }
         }
         return collisionList;
     }
     else
     {
         character.Move(character.leader.speed);
         return null;
     }
 }
Ejemplo n.º 2
0
 public void AddCharacter(TDCharacter character)
 {
     character.sortZ = -character.y;
     _charCont.AddChild (character);
 }
Ejemplo n.º 3
0
 public void AddCharacter(TDCharacter character)
 {
     character.map = this;
     _floorLayer.AddCharacter(character);
 }