예제 #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;
 }