Exemple #1
0
        public void Reset()
        {
            List <Vector2> nodes = new List <Vector2>();

            for (float i = 0; i < (float)Math.PI * 2; i += 30 * 2 * (float)Math.PI / 360)
            {
                nodes.Add(new Vector2(X + 100 * (float)Math.Cos(i), Y + 100 * (float)Math.Sin(i)));
            }

            centerTrack  = new Spline(nodes, true, 1, Palette.CoinYellow);
            outsideTrack = new Spline(nodes, true, 3, Color.White);
            insideTrack  = new Spline(nodes, true, 3, Color.White);

            outSideOutOfBounds = new Spline(nodes, true, 1, Palette.BloodRed);
            insideOutOfBounds  = new Spline(nodes, true, 1, Palette.BloodRed);

            outsideTrack.AddPadding(-trackPadding);
            insideTrack.AddPadding(trackPadding);

            outSideOutOfBounds.AddPadding(-trackPadding - 3);
            insideOutOfBounds.AddPadding(trackPadding + 5);

            Start = centerTrack.Circles[0].Location;

            CreateBoundaries();
            CreateCheckPoints();

            SetEditMode(true);
        }