コード例 #1
0
ファイル: Game.cs プロジェクト: Shame625/Snake-Prototype
        void Initialization()
        {
            _gameInProgress = false;
            _P1blocks.Clear();
            _P2blocks.Clear();

            _currentLocationP1 = _currentLocationP2 = MapManager.getIndex(_selectedMap._spawnPoint._x, _selectedMap._spawnPoint._y, _selectedMap._xSize);

            _P1blocks.Add(_currentLocationP1);
            _P2blocks.Add(_currentLocationP2);

            P1Direction = P2Direction = Constants.GAME_DIRECTION_RIGHT;

            _currentMapP1 = (UInt16[])MapManager._Maps[_mapId]._indexedGrid.Clone();
            _currentMapP2 = (UInt16[])MapManager._Maps[_mapId]._indexedGrid.Clone();

            SpawnNewBug(false);
            SpawnNewBug(true);
        }
コード例 #2
0
 public UInt16 GetSpawnPointIndex()
 {
     return(MapManager.getIndex(_spawnPoint._x, _spawnPoint._y, _xSize));
 }