Пример #1
0
 public TimeTrialMode(GameManager gameInstance, int laps, List<Vector3[]> checkpoints, Vector3[] goalLine)
     : base(gameInstance)
 {
     this.laps = laps;
     this.checkpoints = checkpoints;
     this.goalLine = goalLine;
 }
Пример #2
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (GameManager game = new GameManager())
     {
         game.Run();
     }
 }
Пример #3
0
 public Player(GameManager game)
     : base(game)
 {
     PlayerName = GameSettings.Default.PlayerName;
     LOCAL_PLAYER = true;
     LastReceived = new PositionMessage();
     LastReceived.Sequence = byte.MinValue;
     RaceTime = TimeSpan.MaxValue;
     State = PlayerState.Lobby;
     Lap = 0;
 }
Пример #4
0
 public Player(GameManager game, byte id, string name)
     : base(game)
 {
     ID = id;
     PlayerName = name;
     LOCAL_PLAYER = false;
     LastReceived = new PositionMessage();
     LastReceived.Sequence = byte.MinValue;
     RaceTime = TimeSpan.MaxValue;
     State = PlayerState.Lobby;
     Lap = 0;
 }
Пример #5
0
 public GameplayMode(GameManager gameInstance)
 {
     this.gameInstance = gameInstance;
     this.Mode = Mode.Singleplayer;
     states = new List<GameModeState>();
     addedTriggers = new List<string>();
     addedObjTriggers = new List<string>();
     GameStarted = true;
     GameOver = false;
     CurrentState = 0;
     Statistics = null;
     StartTime = TimeSpan.Zero;
 }
Пример #6
0
        private TimeSpan WaitConnect = new TimeSpan(0, 0, 1); // 3 second wait

        #endregion Fields

        #region Constructors

        public ServerClient(GameManager game)
            : base(game)
        {
            NetPeerConfiguration config = new NetPeerConfiguration("DATX02");
            config.EnableMessageType(NetIncomingMessageType.DiscoveryResponse);

            ServerThread = new NetClient(config);
            ServerThread.Start();

            Sender = new ServerSender(ServerThread, this);
            Receiver = new ServerReceiver(ServerThread, this);
            Game = game;
            LocalPlayer = new Player(game);
            State = ServerState.Lobby;
        }
Пример #7
0
        public SimpleRaceMode(GameManager gameInstance, int laps, int noOfCheckpoints, RaceTrack raceTrack, Car localCar)
            : base(gameInstance)
        {
            this.laps = laps;
            this.checkpoints = noOfCheckpoints;
            this.raceTrack = raceTrack;
            this.car = localCar;
            this.placementRasterization = raceTrack.GetCurveRasterization(100);
            PlayerPlace = 1;
            GameStarted = false;
            TotalRaceTime = TimeSpan.Zero;

            var player = gameInstance.GetService<Player>();
            player.Lap = 0;
            players.Add(player);

            Initialize();
        }
Пример #8
0
        public GameManager()
        {
            Graphics = new GraphicsDeviceManager(this);
            BaseComponents = new List<IGameComponent>();
            Content.RootDirectory = "Content";
            Instance = this;

            Graphics.PreferredBackBufferWidth = GameSettings.Default.ResolutionWidth;
            Graphics.PreferredBackBufferHeight = GameSettings.Default.ResolutionHeight;

            //if (GameSettings.Default.FullScreen != Graphics.IsFullScreen)
            //    Graphics.ToggleFullScreen();

            //UniversalRandom.ResetInstance(0);

            var profilerGameComponent = new ProfilerGameComponent(this, "ProfilerFont");
            ProfilingManager.Run = false;
            Components.Add(profilerGameComponent);

            IsMouseVisible = true;
        }
Пример #9
0
 public CarControlComponent(GameManager game)
     : base(game)
 {
     this.input = game.GetService<InputComponent>();
     this.simulationStrategy = new DeadReckoningStrategy(Game);
 }
Пример #10
0
 public CameraComponent(GameManager game)
     : base(game)
 {
 }
Пример #11
0
 public InputComponent(GameManager game)
     : base(game)
 {
     InputEnabled = true;
 }
Пример #12
0
 public HUDConsoleComponent(GameManager game)
     : base(game)
 {
     Game1 = game;
 }