예제 #1
0
 /// <summary>
 /// Method called at the end of a race to display high score data.
 /// </summary>
 /// <param name="race">The race manager object.</param>
 public void LevelOver( Race race )
 {
     int place = 1;
     resultText.text = "";
     foreach( Racer r in race.rankings() )
     {
         resultText.text = resultText.text + place++ + ". " + r.ToString() + " - " + TimeSpan.FromMilliseconds(r.time).ToString().Substring(0, 11) + "\n";
     }
     ready = false;
 }
예제 #2
0
        /// <summary>
        /// Set up the course for AI's to follow.  This should be moved later
        /// </summary>
        public void SetupCourse(String mapName)
        {
            GammaDraconis.GetInstance().GameLua.LoadMap(mapName);
            course.init();

            Coords spot = course.checkpoints[0].position;
            Vector3 pos = spot.pos();

            for (int i = 0; i < players.Length; i++)
            {
                gameScene.track(players[i], GO_TYPE.RACER);
                players[i].position = new Coords(pos.X - (3.5f - 2 * i) * (players[i].size * 1.4f), pos.Y, pos.Z + 2 * players[i].size);
                players[i].position.R = spot.R;
            }

            race = new Race(course, players);
        }