Exemplo n.º 1
0
        public GameLogic(int[] crucialPoints, int pointsCount)
        {
            Laps = 0;

            // Set up the reference points in the track
            _crucialPoints = crucialPoints;
            _pointsCount = pointsCount;
            didReachCrucialPoint = new Dictionary<int, bool>(4);
            ResetCrucialPoints();

            // Set up the ranking and elimination lists
            taken = new int[kMaximumPlayers];
            _eliminatedCars = 0;

            Ranking = new int[kMaximumPlayers];
            isMiniRaceOver = false;

            _eliminatedCarEvent = new EliminatedCarEventArgs(0);
            _finishedLapEvent = new FinishedLapEventArgs(0);
        }
Exemplo n.º 2
0
 public void setLap(object sender, FinishedLapEventArgs e)
 {
     int lap = e.LapNumber;
     int y = lap / 3;
     int x = lap % 3;
     nLapsVertices[0].TextureCoordinate.X = 0.33f * x;
     nLapsVertices[0].TextureCoordinate.Y = 0.33f * y;
     nLapsVertices[1].TextureCoordinate.X = 0.33f * (x + 1);
     nLapsVertices[1].TextureCoordinate.Y = 0.33f * y;
     nLapsVertices[2].TextureCoordinate.X = 0.33f * x;
     nLapsVertices[2].TextureCoordinate.Y = 0.33f * (y + 1);
     nLapsVertices[3].TextureCoordinate.X = 0.33f * (x + 1);
     nLapsVertices[3].TextureCoordinate.Y = 0.33f * y;
     nLapsVertices[4].TextureCoordinate.X = 0.33f * (x + 1);
     nLapsVertices[4].TextureCoordinate.Y = 0.33f * (y + 1);
     nLapsVertices[5].TextureCoordinate.X = 0.33f * x;
     nLapsVertices[5].TextureCoordinate.Y = 0.33f * (y + 1);
 }
Exemplo n.º 3
0
 public void ResetStickyNotes(object sender, FinishedLapEventArgs e)
 {
     for (int i = 0; i < postItDreamsList.Count; i++)
     {
         postItDreamsList[i].color = Color.White;
     }
 }