示例#1
0
        private static void AssertObjectListHasLevelSize(int width, int height, int expected)
        {
            var level   = new Level(new Size(width, height));
            var handler = new LevelObjectHandler(level);

            Assert.AreEqual(expected, handler.ObjectList.Length);
        }
示例#2
0
    public void Setup(LevelContainer.CaveType[] caveList, bool bEndless, LevelObjectHandler objHandler)
    {
        _levelCaveList = caveList;
        _objectHandler = objHandler;
        _bEndlessMode  = bEndless;

        _caveZ     = Toolbox.Instance.ZLayers["Cave"];
        _tileSizeX = Toolbox.TileSizeX;

        if (_bEndlessMode)
        {
            _endlessCave = new CaveRandomiser();
            // TODO generate random cave
        }
        else
        {
            _numCavePieces = _levelCaveList.Length;
            GeneratePresetLevelCave();
            SetStartingObstacles();
        }
        _cavePieceCounter = 0;
    }
示例#3
0
 private void CreateGameObjects()
 {
     _levelObjects = _levelScripts.AddComponent <LevelObjectHandler>();
 }
示例#4
0
 public void SetUp()
 {
     objectHandler = new LevelObjectHandler(16);
 }
		private static void AssertObjectListHasLevelSize(int width, int height, int expected)
		{
			var level = new Level(new Size(width, height));
			var handler = new LevelObjectHandler(level);
			Assert.AreEqual(expected, handler.ObjectList.Length);
		}
		public void SetUp()
		{
			objectHandler = new LevelObjectHandler(16);
		}