Ejemplo n.º 1
0
        // constructor
        public Player(List<Player> others, List<Player> allplayers, Ball ball, bool isTeamA, int id)
        {
            m_others = others;
            m_AllPlayers = allplayers;
            m_Ball = ball;
            b_ImTeamA = isTeamA;
            m_MyID = id;

            Reset();
        }
Ejemplo n.º 2
0
 public override void Open()
 {
     // Make a field
     bbox = new AABBox(new Vector3(-20, 0, -10), new Vector3(20, 0, 10));
     // Red goal
     teamAGoal = new AABBox(new Vector3(-21, 0, -7), new Vector3(-19, 0, 7));
     // Blue Goal
     teamBGoal = new AABBox(new Vector3(19, 0, -7), new Vector3(21, 0, 7));
     // Make a ball
     ball = new Ball(bbox);
     // Build team A
     const int PlayerCountA = 8;
     for (int i = 0; i < PlayerCountA; i++)
     {
         Player pMicTest = new Player(teamA, allPlayers, ball, true, i);
         Demo.SelectedVehicle = pMicTest;
         teamA.Add(pMicTest);
         allPlayers.Add(pMicTest);
     }
     // Build Team B
     const int PlayerCountB = 8;
     for (int i = 0; i < PlayerCountB; i++)
     {
         Player pMicTest = new Player(teamB, allPlayers, ball, false, i);
         Demo.SelectedVehicle = pMicTest;
         teamB.Add(pMicTest);
         allPlayers.Add(pMicTest);
     }
     // initialize camera
     Demo.Init2dCamera(ball);
     Demo.Camera.SetPosition(10, Demo.Camera2dElevation, 10);
     Demo.Camera.FixedPosition = new Vector3(40);
     Demo.Camera.Mode = Camera.CameraMode.Fixed;
     redScore = 0;
     blueScore = 0;
 }