Exemplo n.º 1
0
 public Bullet(Player con, Point origin, int dir)
 {
     shooter = con;
     pos = origin;
     Direction = dir;
     Console.WriteLine("Bullet shot at " + pos.X + "," + pos.Y + "," + direction);
     //    RandomGen r = new RandomGen();
     //    id = r.randomD(1000);
 }
Exemplo n.º 2
0
        //initialize game
        public void initGame(String[] token)
        {
            playerCount = token.Length - 1;
            playerArray = new Player[playerCount];

            for (int x = 1; x < token.Length; x++)
            {
                String[] playerInfo = token[x].Split(';');
                String[] coord = playerInfo[1].Split(',');

                if((x-1)==playerIndex)  //X starts from 1
                    playerArray[x - 1] = new Player(playerInfo[0], coord[0], coord[1], playerInfo[2]);
                else
                    playerArray[x - 1] = new Player(playerInfo[0], coord[0], coord[1], playerInfo[2],"E");
            }
        }