コード例 #1
0
    public override void _Ready()
    {
        root          = (Node2D)GetTree().GetRoot().GetNode("GameHandler");
        cam           = (Camera2D)root.FindNode("CamMv").FindNode("Cam");
        sky           = (Sprite)root.FindNode("CamMv").FindNode("Sky");
        borderHandler = (BorderHandler)FindNode("Border");
        root.FindNode("UI").FindNode("NextTurn").Connect("pressed", this, nameof(_on_next_turn));
        SetProcessInput(true);

        player   = new Player(0, (Label)root.FindNode("UI").FindNode("Player"));
        turnInfo = new TurnInfo(3, (Label)root.FindNode("UI").FindNode("CurrentPlayer"));

        Color[] teamColors = new Color[8];
        teamColors[0] = new Color(51 / 255f, 102 / 255f, 204 / 255f, 1);
        teamColors[1] = new Color(204 / 255f, 51 / 255f, 51 / 255f, 1);
        teamColors[2] = new Color(0f / 255f, 204 / 255f, 51 / 255f, 1);
        teamColors[3] = new Color(230 / 255f, 230 / 255f, 0 / 255f, 1);

        teamColors[4] = new Color(51 / 255f, 204 / 255f, 204 / 255f, 1);
        teamColors[5] = new Color(204 / 255f, 0 / 255f, 204 / 255f, 1);
        teamColors[6] = new Color(204 / 255f, 204 / 255f, 204 / 255f, 1);
        teamColors[7] = new Color(255f / 255f, 153 / 255f, 51 / 255f, 1);

        borderHandler.Init(turnInfo.GetAmountOfPlayers(), teamColors);
        ZoomHandle();
    }
コード例 #2
0
        public override void _Ready()
        {
            base._Ready();
            this.BegunInitialisation = true;

            this.LoadingMessage = "Initialising object pools";
            Node2D worldHolder  = this.GetNode <Node2D>("WorldHolder");
            Node2D floorHolder  = (Node2D)worldHolder.FindNode("WorldFloors");
            Node2D wallHolder   = (Node2D)worldHolder.FindNode("WorldWalls");
            Node2D objectHolder = (Node2D)worldHolder.FindNode("WorldObjects");
            Node2D entityHolder = (Node2D)worldHolder.FindNode("WorldEntities");
            Node2D fogHolder    = (Node2D)worldHolder.FindNode("WorldFog");

            this.MyNode = this;

            this.LoadingThread = new Thread(this.Load);
            this.LoadingThread.Start();
        }
コード例 #3
0
    public override void _Ready()
    {
        _parent = GetParent() as Node2D;
        Sprite sprite = (_parent.FindNode("Sprite") as Sprite);

        if (sprite == null)
        {
            Global.Log("Unable to add sprite trail, could not find sprite");
            QueueFree();
            _spawnTimer = -1;
        }
        else
        {
            _texture = sprite.Texture;
        }
    }