Ejemplo n.º 1
0
 private void createNewArea(int width, int height)
 {
     //create tilemap
     area = null;
     area = new Area();
     area.MapSizeX = width;
     area.MapSizeY = height;
     for (int index = 0; index < (width * height); index++)
     {
         Tile newTile = new Tile();
         newTile.Walkable = true;
         newTile.LoSBlocked = false;
         newTile.Visible = false;
         area.Tiles.Add(newTile);
     }
     refreshLeftPanelInfo();
     panelView.Width = area.MapSizeX * sqr;
     panelView.Height = area.MapSizeY * sqr;
     panelView.BackgroundImage = (Image)surface;
     device = Graphics.FromImage(surface);
     if (surface == null)
     {
         MessageBox.Show("returned a null Map bitmap");
         return;
     }
     refreshMap(true);
 }
Ejemplo n.º 2
0
 private void btnPlusTopY_Click(object sender, EventArgs e)
 {
     //y * area.MapSizeX + x
     for (int i = 0; i < area.MapSizeX; i++)
     {
         Tile newTile = new Tile();
         area.Tiles.Insert(0, newTile);
     }
     foreach (Prop prpRef in area.Props)
     {
         prpRef.LocationY++;
     }
     foreach (Trigger t in area.Triggers)
     {
         foreach (Coordinate p in t.TriggerSquaresList)
         {
             p.Y++;
         }
     }
     area.MapSizeY++;
     mapSizeChangeStuff();
 }
Ejemplo n.º 3
0
 private void btnPlusRightX_Click(object sender, EventArgs e)
 {
     //y * area.MapSizeX + x
     int oldX = area.MapSizeX;
     for (int i = area.Tiles.Count - 1; i >= 0; i -= oldX)
     {
         Tile newTile = new Tile();
         area.Tiles.Insert(i + 1, newTile);
     }
     area.MapSizeX++;
     mapSizeChangeStuff();
 }
Ejemplo n.º 4
0
 private void btnPlusLeftX_Click(object sender, EventArgs e)
 {
     //y * area.MapSizeX + x
     int oldX = area.MapSizeX;
     for (int i = area.Tiles.Count - oldX; i >= 0; i -= oldX)
     {
         Tile newTile = new Tile();
         area.Tiles.Insert(i, newTile);
     }
     foreach (Prop prpRef in area.Props)
     {
         prpRef.LocationX++;
     }
     foreach (Trigger t in area.Triggers)
     {
         foreach (Coordinate p in t.TriggerSquaresList)
         {
             p.X++;
         }
     }
     area.MapSizeX++;
     mapSizeChangeStuff();
 }
Ejemplo n.º 5
0
 private void btnPlusBottumY_Click(object sender, EventArgs e)
 {
     //y * area.MapSizeX + x
     for (int i = 0; i < area.MapSizeX; i++)
     {
         Tile newTile = new Tile();
         area.Tiles.Add(newTile);
     }
     area.MapSizeY++;
     mapSizeChangeStuff();
 }
Ejemplo n.º 6
0
 private void resetAreaTileValues(int width, int height)
 {
     //create tilemap
     //area = null;
     //area = new Area();
     area.MapSizeX = width;
     area.MapSizeY = height;
     //area.MapSizeInPixels.Width = width * tileSize;
     //area.MapSizeInPixels.Height = height * tileSize;
     for (int index = 0; index < (width * height); index++)
     {
         Tile newTile = new Tile();
         newTile.Walkable = true;
         newTile.LoSBlocked = false;
         newTile.Visible = false;
         area.Tiles.Add(newTile);
     }
 }