Beispiel #1
0
        public Level(TowerDefense game, int cellSize, int rows, int columns, Point end, List<Wave> waves, int id)
            : base(game)
        {
            this.cellSize = cellSize;
            this.end = end;
            this.Id = id;
            InitializeMap(rows, columns);
            Lost = false;
            Won = false;
            this.game = game;
            componentList = new List<GameComponent>();

            towerManager = new TowerManager(game);
            enemyManager = new EnemyManager(game);
            projectileManager = new ProjectileManager(game);
            spawner = new Spawner(game, enemyManager.enemies, waves);
            camera = new Camera(game, Vector2.Zero, columns*cellSize, rows*cellSize);
            Paused = false;

            pathfinding = Pathfinding.createPath(IntObjectMap, new Point(0, 0), End);
        }
Beispiel #2
0
        public Level(GraphicsDevice graphics)
        {
            path = new SimplePath(graphics);
            path.Clean();

            path.AddPoint(new Vector2(225, -64));
            path.AddPoint(new Vector2(190, 535));
            path.AddPoint(new Vector2(240, 700));
            path.AddPoint(new Vector2(350, 760));
            path.AddPoint(new Vector2(555, 745));
            path.AddPoint(new Vector2(635, 645));
            path.AddPoint(new Vector2(620, 470));
            path.AddPoint(new Vector2(605, 290));
            path.AddPoint(new Vector2(655, 200));
            path.AddPoint(new Vector2(780, 155));
            path.AddPoint(new Vector2(935, 195));
            path.AddPoint(new Vector2(990, 345));
            path.AddPoint(new Vector2(960, 984));

            creepManager = new CreepManager(ref path);
            towerManager = new TowerManager(ref creepManager, graphics);
        }
        public Level(GraphicsDevice graphics)
        {
            path = new SimplePath(graphics);
            path.Clean();

            path.AddPoint(new Vector2(225, -64));
            path.AddPoint(new Vector2(190, 535));
            path.AddPoint(new Vector2(240, 700));
            path.AddPoint(new Vector2(350, 760));
            path.AddPoint(new Vector2(555, 745));
            path.AddPoint(new Vector2(635, 645));
            path.AddPoint(new Vector2(620, 470));
            path.AddPoint(new Vector2(605, 290));
            path.AddPoint(new Vector2(655, 200));
            path.AddPoint(new Vector2(780, 155));
            path.AddPoint(new Vector2(935, 195));
            path.AddPoint(new Vector2(990, 345));
            path.AddPoint(new Vector2(960, 984));

            creepManager = new CreepManager(ref path);
            towerManager = new TowerManager(ref creepManager, graphics);
        }