예제 #1
0
 private void clearTileDataToolStripMenuItem_Click(object sender, EventArgs e)
 {
     for (int x = 0; x < game.game.tilemap.MapWidth; x++)
     {
         for (int y = 0; y < game.game.tilemap.MapHeight; y++)
         {
             Tile t = game.game.tilemap.tileMap[x, y];
             t.Collidable = false;
             t.Portal     = false;
             t.Data       = "";
             t.Filename   = "";
             for (int z = 0; z < 3; z++)
             {
                 t.SetTileNum(z, game.game.tilemap.TransparentTile);
             }
             game.game.tilemap.tileMap[x, y] = t;
         }
     }
 }
예제 #2
0
        private void btnTileUpdate_Click(object sender, EventArgs e)
        {
            if (!rdo_edit.Checked)
            {
                return;
            }
            Tile tile;

            tile = new Tile(game.game.tilemap.TileWidth,
                            game.game.tilemap.TileHeight);
            for (int z = 0; z < game.game.tilemap.MapLayers; z++)
            {
                tile.SetTileNum(z, game.game.tilemap.tileMap[selectedTileX, selectedTileY].getTileNum(z));
            }
            tile.Collidable = chk_collidable.Checked;
            tile.Portal     = chk_portal.Checked;
            tile.Filename   = txtFilename.Text;
            tile.Data       = txtCodeValue.Text;
            game.game.tilemap.tileMap[selectedTileX, selectedTileY] = tile;
        }