コード例 #1
0
    private void LoadTiles(List <string> textlines, int width, Dictionary <char, string> tiletypechar)
    {
        LevelGrid level = new LevelGrid(width, textlines.Count, 0, "levelgrid");

        RootList.Add(level);
        level.CellWidth  = 108;
        level.CellHeight = 54;

        Camera camera = GetObject("camera") as Camera;

        camera.Width  = (width) * level.CellWidth / 2;
        camera.Height = (textlines.Count) * level.CellHeight;

        for (int x = 0; x < width; x++)
        {
            for (int y = 0; y < textlines.Count; y++)
            {
                try
                {
                    Tile t = LoadTile(x, y, tiletypechar[textlines[y][x]]);
                    level.Add(t, x, y);
                }
                catch
                {
                    Tile t = LoadTile(x, y, tiletypechar['a']);
                    level.Add(t, x, y);
                }
            }
        }
    }
コード例 #2
0
    public void LoadTiles(List <string> textlines, int width, Dictionary <char, string> tiletypechar)
    {
        LevelGrid level = new LevelGrid(width, textlines.Count, 0, "tiles");

        RootList.Add(level);
        level.CellWidth  = 108;
        level.CellHeight = 54;

        Camera camera = GetObject("camera") as Camera;

        camera.Width  = (width) * level.CellWidth / 2;
        camera.Height = (textlines.Count) * level.CellHeight;

        for (int x = 0; x < width; x++)
        {
            for (int y = 0; y < textlines.Count; y++)
            {
                Tile t;
                if (textlines[y][x] == '1')
                {
                    t = LoadPlayer(x, y);
                }
                else
                {
                    t = LoadTile(x, y, tiletypechar[textlines[y][x]]);
                }
                level.Add(t, x, y);
            }
        }
    }
コード例 #3
0
ファイル: Level.cs プロジェクト: nicholaschiasson/snatch3d-vr
 public void AddRow(List <AbstractGameObject> row)
 {
     LevelGrid.Add(row);
 }