public GameplayManager(GameWindow window) {
            world = new World(Vector2.Zero);
            ConvertUnits.SetDisplayUnitToSimUnitRatio(20.0f); //Not sure what a good number is here?
            vfx = new VisualEffectsManager();

            this.window = window;
            grid = new Grid(world);
            armyController = new PlayerController(this, 0);

            SpawnUnit(new Vector2(150, 150), 0, UnitTypes.Ranged);
            SpawnUnit(new Vector2(250, 150), 1, UnitTypes.Ranged);
            SpawnUnit(new Vector2(252, 150), 1, UnitTypes.Melee);
            SpawnUnit(new Vector2(290, 150), 0, UnitTypes.Melee);
            SpawnUnit(new Vector2(150, 170), 0, UnitTypes.Melee);
            SpawnUnit(new Vector2(250, 170), 1, UnitTypes.Melee);
            SpawnUnit(new Vector2(252, 170), 1, UnitTypes.Ranged);
            SpawnUnit(new Vector2(290, 170), 0, UnitTypes.Ranged);
            SpawnUnit(new Vector2(150, 190), 0, UnitTypes.Ranged);
            SpawnUnit(new Vector2(250, 190), 1, UnitTypes.Ranged);
            SpawnUnit(new Vector2(252, 190), 1, UnitTypes.Ranged);
            SpawnUnit(new Vector2(290, 190), 0, UnitTypes.Ranged);
            SpawnBase(10,3, 0);
            SpawnBarracks(14, 6, 0);

            SpawnBarracks(18, 8, 1);
            
        }
        public Building(GameplayManager gm, int gridX, int gridY, int faction, World world, int tileWidth, int tileHeight, int HP, float visionRange, Grid grid)
            : base(gm, new Vector2(((float)gridX + (float)tileWidth / 2.0f) * Grid.TileSize, ((float)gridY + (float)tileHeight / 2.0f) * Grid.TileSize), faction, HP, visionRange, world)
        {
            body = BodyFactory.CreateRectangle(world, ConvertUnits.ToSimUnits(tileWidth * Grid.TileSize), ConvertUnits.ToSimUnits(tileHeight * Grid.TileSize), 10, ConvertUnits.ToSimUnits(new Vector2(((float)gridX + (float)tileWidth / 2.0f) * Grid.TileSize, ((float)gridY + (float)tileHeight / 2.0f) * Grid.TileSize)));
            body.BodyType = BodyType.Static;
            body.CollisionCategories = Category.All;
            body.CollidesWith = Category.All;

            width = tileWidth * Grid.TileSize;
            height = tileHeight * Grid.TileSize;
            this.tileHeight = tileHeight;
            this.tileWidth = tileWidth;
            this.gridX = gridX;
            this.gridY = gridY;
            this.grid = grid;

            BlockTiles();
            grid.AssignNeighbours();

            radius = Math.Max(width / 2.0f, height / 2.0f);
            bounds = new Rectangle((int)(Position.X - width / 2.0f), (int)(Position.Y - height / 2.0f), (int)width, (int)height);
        }
 public Pathfinder(Grid grid)
 {
     this.grid = grid;
 }
 public Barracks(GameplayManager gm, int gridX, int gridY, int faction, World world, Grid grid)
     : base(gm, gridX, gridY, faction, world, 2, 2, 500, 150.0f, 200, grid)
 {
 }
Beispiel #5
0
 public Base(GameplayManager gm, int gridX, int gridY, int faction, World world, Grid grid) : base(gm,gridX,gridY,faction,world,3,3,1000,200.0f, grid) { 
 
 }