예제 #1
0
 //是否死亡
 public bool BeEat(Monster monster)
 {
     if (monster.C == this.c && monster.R == this.r)
         return true;
     else
         return false;
 }
예제 #2
0
 public void InitMember3()
 {
     row = data3.GetLength(0);
     col = data3.GetLength(1);
     map = new Block[row, col];
     for (int i = 0; i < row; i++)
     {
         for (int j = 0; j < col; j++)
         {
             if (data3[i, j] == 0)
             {
                 map[i, j] = new Empty(i, j);
             }
             if (data3[i, j] == 1)
             {
                 map[i, j] = new Wall(i, j);
             }
             if (data3[i, j] == 2)
             {
                 map[i, j] = new Bean(i, j);
                 beanNum++;
             }
         }
     }
     pacman = new Pacman(1, 1);
     monster[0] = new Monster(7, 2);
     monster[1] = new Monster(6, 1);
     monster[2] = new Monster(8, 10);
 }