Exemplo n.º 1
0
 bool CheckOtherPos(BigEnemyBodyPart bodyPart, int additionX, int additionY)
 {
     if (GameManager.map.mapArray[bodyPart.position.y + additionY, bodyPart.position.x + additionX].type == Type.Empty || GameManager.map.mapArray[bodyPart.position.y + additionY, bodyPart.position.x + additionX].type == Type.Player ||
         GameManager.map.mapArray[bodyPart.position.y + additionY, bodyPart.position.x + additionX].type == Type.Vendor || GameManager.map.mapArray[bodyPart.position.y + additionY, bodyPart.position.x + additionX].type == Type.Entrance)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemplo n.º 2
0
        public BigEnemy(Position position)
        {
            bigEnemyPartList = new List <BigEnemyBodyPart>(4);

            upperLeft            = new BigEnemyBodyPart();
            upperLeft.position.x = position.x;
            upperLeft.position.y = position.y;
            bigEnemyPartList.Add(upperLeft);

            upperRight            = new BigEnemyBodyPart();
            upperRight.position.x = position.x + 1;
            upperRight.position.y = position.y;
            bigEnemyPartList.Add(upperRight);

            lowerLeft            = new BigEnemyBodyPart();
            lowerLeft.position.x = position.x;
            lowerLeft.position.y = position.y + 1;
            bigEnemyPartList.Add(lowerLeft);

            lowerRight            = new BigEnemyBodyPart();
            lowerRight.position.x = position.x + 1;
            lowerRight.position.y = position.y + 1;
            bigEnemyPartList.Add(lowerRight);
        }