Example #1
0
  public void setBlock(int i, int j, boolean meOrEnemy) { // true면 me, false면 enemy
    // 상대방의 정보를 갱신하는 거라면 여기서 색깔 바꿔주면 되겠네

    if (meOrEnemy == true) {

      block[my_i][my_j] = 0;
      my_i = i;
      my_j = j;
      block[my_i][my_j] = mPlayerInformation.getType() == 1 ? 1 : 2;

    } else {
      block[enemy_i][enemy_j] = 0;

      enemy_i = i;
      enemy_j = j;
      block[enemy_i][enemy_j] = mPlayerInformation.getType() == 1 ? 2 : 1;
    }
  }
Example #2
0
  private BoardState() {

    mPlayerInformation = PlayerInformation.getMyPlayer();

    block = new int[11][7];
    wall_h = new int[10][7];
    wall_v = new int[11][6];

    itemState = new int[3];

    my_i = 10;
    my_j = 3;
    enemy_i = 0;
    enemy_j = 3;

    changedWalltype = null;
    changedWall_i = -1;
    changedWall_j = -1;
    my_numOfWall = 8;
    enemy_numOfWall = 8;
  }
 // handle the player by giving them a player number.
 public void handlePlayer(PlayerInformation server) {
   generateMap(server);
   server.playerNumber = playerNumber;
   clientSockets.get(playerNumber - 1).write(server);
   playerNumber++;
 }
 /// stores the number and tile indexes in the two arrays
 public void generateMap(PlayerInformation server) {
   server.SOCnumberIndex = map.numberIndex;
   server.SOCtileIndex = map.tileIndex;
 }