public TimeTrialMode(GameManager gameInstance, int laps, List<Vector3[]> checkpoints, Vector3[] goalLine) : base(gameInstance) { this.laps = laps; this.checkpoints = checkpoints; this.goalLine = goalLine; }
/// <summary> /// The main entry point for the application. /// </summary> static void Main(string[] args) { using (GameManager game = new GameManager()) { game.Run(); } }
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; }
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; }
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; }
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; }
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(); }
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; }
public CarControlComponent(GameManager game) : base(game) { this.input = game.GetService<InputComponent>(); this.simulationStrategy = new DeadReckoningStrategy(Game); }
public CameraComponent(GameManager game) : base(game) { }
public InputComponent(GameManager game) : base(game) { InputEnabled = true; }
public HUDConsoleComponent(GameManager game) : base(game) { Game1 = game; }