Esempio n. 1
0
    // Called when the node enters the scene tree for the first time.
    public override void _Ready()
    {
        width  = 79;
        height = 45;
        map    = new List <bool>();
        timer  = new Timer();
        AddChild(timer);
        AddUserSignal("finished");
        AddUserSignal("finished_generating");
        AddUserSignal("finished_pathfinding", new Godot.Collections.Array {
            this, new Godot.Collections.Array <int> (), new Godot.Collections.Array <int>()
        });

        container = GetNode("GridContainer") as GridContainer;
        container.SetColumns(width);

        for (int i = 0; i < width * height; i++)
        {
            ColorRect rect = new ColorRect();
            rect.SetFrameColor(wallColour);

            rect.SetCustomMinimumSize(blockSize);
            container.AddChild(rect);

            map.Add(false);
        }

        ResizeBlock();
    }