Ejemplo n.º 1
0
        public CellularAutomata()
        {
            // default iteration count
            IterationCount = DefaultIterationCount;

            // add the randomise level pre-algorithm
            Generation.RandomiseLevel randomise = new RandomiseLevel();

            GameObject floor = Procreate.MainWindow.ControlPoint.GameObjectFactory.CreateGameObject();

            floor.Name       = FloorDummy;
            floor.ImagePath  = Level.Level.FloorImagePath;
            floor.AppearRate = 50;
            Generation.GameObjectChancePair floorPair = new Generation.GameObjectChancePair(floor, FloorChance);

            GameObject wall = Procreate.MainWindow.ControlPoint.GameObjectFactory.CreateGameObject();

            wall.Name       = WallDummy;
            wall.ImagePath  = Level.Level.WallImagePath;
            wall.AppearRate = 50;
            Generation.GameObjectChancePair wallPair = new Generation.GameObjectChancePair(wall, WallChance);

            randomise.GameObjectPool.Add(floorPair);
            randomise.GameObjectPool.Add(wallPair);
            PreAlgorithms.Add(randomise);
        }
Ejemplo n.º 2
0
        public CellularAutomata()
        {
            // default iteration count
            IterationCount = DefaultIterationCount;

            // add the randomise level pre-algorithm
            Generation.RandomiseLevel randomise = new RandomiseLevel();

            GameObject floor = Procreate.MainWindow.ControlPoint.GameObjectFactory.CreateGameObject();
            floor.Name = FloorDummy;
            floor.ImagePath = Level.Level.FloorImagePath;
            floor.AppearRate = 50;
            Generation.GameObjectChancePair floorPair = new Generation.GameObjectChancePair(floor, FloorChance);

            GameObject wall = Procreate.MainWindow.ControlPoint.GameObjectFactory.CreateGameObject();
            wall.Name = WallDummy;
            wall.ImagePath = Level.Level.WallImagePath;
            wall.AppearRate = 50;
            Generation.GameObjectChancePair wallPair = new Generation.GameObjectChancePair(wall, WallChance);

            randomise.GameObjectPool.Add(floorPair);
            randomise.GameObjectPool.Add(wallPair);
            PreAlgorithms.Add(randomise);
        }