コード例 #1
0
ファイル: FreeForAll.cs プロジェクト: darocha/CycleR
        public List <GameSpawn> GetGameSpawns()
        {
            GameSpawn[] spawnsCopy = new GameSpawn[_playerCount];
            _spawns.CopyTo(spawnsCopy, 0);

            _gen.Shuffle <GameSpawn>(spawnsCopy);

            return(new List <GameSpawn>(spawnsCopy));
        }
コード例 #2
0
ファイル: FreeForAll.cs プロジェクト: pksorensen/CycleR
        public List<GameSpawn> GetGameSpawns()
        {
            GameSpawn[] spawnsCopy = new GameSpawn[_playerCount];
            _spawns.CopyTo(spawnsCopy, 0);

            _gen.Shuffle<GameSpawn>(spawnsCopy);

            return new List<GameSpawn>(spawnsCopy);
        }
コード例 #3
0
ファイル: FreeForAll.cs プロジェクト: darocha/CycleR
        public FreeForAll()
        {
            double halfMapSize = _gameConfiguration.MapConfig.MAP_SIZE.Width * .5,
                   halfPI      = Math.PI / 2;

            _spawns[0] = new GameSpawn
            {
                StartVelocity = new Vector3(_gameConfiguration.CycleConfig.MAX_SPEED, 0, 0),
                StartPosition = new Vector3(-halfMapSize + _gameConfiguration.MapConfig.MAP_START_PADDING, _gameConfiguration.CycleConfig.Y_OFFSET, -halfMapSize + _gameConfiguration.MapConfig.MAP_START_PADDING),
                StartRotation = Math.PI + halfPI,
                TrailColor    = 0xff0000
            };

            _spawns[1] = new GameSpawn
            {
                StartVelocity = new Vector3(0, 0, _gameConfiguration.CycleConfig.MAX_SPEED),
                StartPosition = new Vector3(halfMapSize - _gameConfiguration.MapConfig.MAP_START_PADDING, _gameConfiguration.CycleConfig.Y_OFFSET, -halfMapSize + _gameConfiguration.MapConfig.MAP_START_PADDING),
                StartRotation = Math.PI,
                TrailColor    = 0x00ff00
            };


            _spawns[2] = new GameSpawn
            {
                StartVelocity = new Vector3(0, 0, -_gameConfiguration.CycleConfig.MAX_SPEED),
                StartPosition = new Vector3(-halfMapSize + _gameConfiguration.MapConfig.MAP_START_PADDING, _gameConfiguration.CycleConfig.Y_OFFSET, halfMapSize - _gameConfiguration.MapConfig.MAP_START_PADDING),
                StartRotation = 0,
                TrailColor    = 0x0000ff
            };

            _spawns[3] = new GameSpawn
            {
                StartVelocity = new Vector3(-_gameConfiguration.CycleConfig.MAX_SPEED, 0, 0),
                StartPosition = new Vector3(halfMapSize - _gameConfiguration.MapConfig.MAP_START_PADDING, _gameConfiguration.CycleConfig.Y_OFFSET, halfMapSize - _gameConfiguration.MapConfig.MAP_START_PADDING),
                StartRotation = halfPI,
                TrailColor    = 0xffff00
            };
        }
コード例 #4
0
ファイル: FreeForAll.cs プロジェクト: pksorensen/CycleR
        public FreeForAll()
        {
            double halfMapSize = _gameConfiguration.MapConfig.MAP_SIZE.Width * .5,
                   halfPI = Math.PI / 2;

            _spawns[0] = new GameSpawn
            {
                StartVelocity = new Vector3(_gameConfiguration.CycleConfig.MAX_SPEED, 0, 0),
                StartPosition = new Vector3(-halfMapSize + _gameConfiguration.MapConfig.MAP_START_PADDING, _gameConfiguration.CycleConfig.Y_OFFSET, -halfMapSize + _gameConfiguration.MapConfig.MAP_START_PADDING),
                StartRotation = Math.PI + halfPI,
                TrailColor = 0xff0000
            };

            _spawns[1] = new GameSpawn
            {
                StartVelocity = new Vector3(0, 0, _gameConfiguration.CycleConfig.MAX_SPEED),
                StartPosition = new Vector3(halfMapSize - _gameConfiguration.MapConfig.MAP_START_PADDING, _gameConfiguration.CycleConfig.Y_OFFSET, -halfMapSize + _gameConfiguration.MapConfig.MAP_START_PADDING),
                StartRotation = Math.PI,
                TrailColor = 0x00ff00
            };

            _spawns[2] = new GameSpawn
            {
                StartVelocity = new Vector3(0, 0, -_gameConfiguration.CycleConfig.MAX_SPEED),
                StartPosition = new Vector3(-halfMapSize + _gameConfiguration.MapConfig.MAP_START_PADDING, _gameConfiguration.CycleConfig.Y_OFFSET, halfMapSize - _gameConfiguration.MapConfig.MAP_START_PADDING),
                StartRotation = 0,
                TrailColor = 0x0000ff
            };

            _spawns[3] = new GameSpawn
            {
                StartVelocity = new Vector3(-_gameConfiguration.CycleConfig.MAX_SPEED, 0, 0),
                StartPosition = new Vector3(halfMapSize - _gameConfiguration.MapConfig.MAP_START_PADDING, _gameConfiguration.CycleConfig.Y_OFFSET, halfMapSize - _gameConfiguration.MapConfig.MAP_START_PADDING),
                StartRotation = halfPI,
                TrailColor = 0xffff00
            };
        }