コード例 #1
0
ファイル: SuddenDeath.cs プロジェクト: longde123/Final-Bomber
        public SuddenDeath(FinalBomber game, Point pos)
        {
            _gameRef           = game;
            _hasStarted        = false;
            _suddenDeathShadow = _gameRef.Content.Load <Texture2D>("Graphics/Sprites/suddenDeathShadow");
            _suddenDeathWall   = _gameRef.Content.Load <Texture2D>("Graphics/Sprites/edgeWall");
            _currentPosition   = pos;
            _previousPosition  = Point.Zero;

            _timer         = TimeSpan.Zero;
            _moveTime      = TimeSpan.FromSeconds(GameConfiguration.SuddenDeathWallSpeed);
            _lookDirection = LookDirection.Right;

            _mapSize = Config.MapSize;
            //_mapSize = game.GamePlayScreen.World.Levels[game.GamePlayScreen.World.CurrentLevel].Size;

            _visited = new bool[_mapSize.X, _mapSize.Y];
            for (int i = 0; i < _mapSize.X; i++)
            {
                _visited[i, 0] = true;
                _visited[i, _mapSize.Y - 1] = true;
            }
            for (int i = 0; i < _mapSize.Y; i++)
            {
                _visited[0, i] = true;
                _visited[_mapSize.X - 1, i] = true;
            }

            // Map moving
            _nextMapPosition = Vector2.Zero;
        }
コード例 #2
0
ファイル: SuddenDeath.cs プロジェクト: Noxalus/Final-Bomber
        public SuddenDeath(FinalBomber game, Point pos)
        {
            _gameRef = game;
            _hasStarted = false;
            _suddenDeathShadow = _gameRef.Content.Load<Texture2D>("Graphics/Sprites/suddenDeathShadow");
            _suddenDeathWall = _gameRef.Content.Load<Texture2D>("Graphics/Sprites/edgeWall");
            _currentPosition = pos;
            _previousPosition = Point.Zero;

            _timer = TimeSpan.Zero;
            _moveTime = TimeSpan.FromSeconds(GameConfiguration.SuddenDeathWallSpeed);
            _lookDirection = LookDirection.Right;

            _mapSize = Config.MapSize;
            //_mapSize = game.GamePlayScreen.World.Levels[game.GamePlayScreen.World.CurrentLevel].Size;

            _visited = new bool[_mapSize.X, _mapSize.Y];
            for (int i = 0; i < _mapSize.X; i++)
            {
                _visited[i, 0] = true;
                _visited[i, _mapSize.Y - 1] = true;
            }
            for (int i = 0; i < _mapSize.Y; i++)
            {
                _visited[0, i] = true;
                _visited[_mapSize.X - 1, i] = true;
            }

            // Map moving
            _nextMapPosition = Vector2.Zero;
        }