Ejemplo n.º 1
0
    public override void _Ready()
    {
        PlayerLeader         = GetNode <Leader>("PlayerLeader");
        EnemyLeadersNode     = GetNode <Node2D>("EnemyLeaders");
        EnemyLeader1         = GetNode <Leader>("EnemyLeaders/EnemyLeader1");
        EnemyLeader2         = GetNode <Leader>("EnemyLeaders/EnemyLeader2");
        EnemyLeader3         = GetNode <Leader>("EnemyLeaders/EnemyLeader3");
        EnemyLeader4         = GetNode <Leader>("EnemyLeaders/EnemyLeader4");
        EnemyLeader5         = GetNode <Leader>("EnemyLeaders/EnemyLeader5");
        EnemyLeader6         = GetNode <Leader>("EnemyLeaders/EnemyLeader6");
        ChallengeButton      = GetNode <Button>("ChallengeButton");
        BorrowButton         = GetNode <Button>("BorrowButton");
        BorrowDoneButton     = GetNode <Button>("BorrowDoneButton");
        SettleDebtButton     = GetNode <Button>("SettleDebtButton");
        SettleDebtDoneButton = GetNode <Button>("SettleDebtDoneButton");
        ButtonAudio          = GetNode <AudioStreamPlayer>("ButtonSelect");

        Vector2 MidPoint = GetViewport().Size / 2;

        ChallengeButton.RectPosition = MidPoint - ChallengeButton.RectSize;

        PopulateUnits(PlayerLeader, new List <int> {
        });
        PopulateUnits(EnemyLeader1, new List <int> {
            1, 1
        });
        PopulateUnits(EnemyLeader2, new List <int> {
            1, 2
        });
        PopulateUnits(EnemyLeader3, new List <int> {
            1, 3
        });
        PopulateUnits(EnemyLeader4, new List <int> {
            3, 3, 5, 5
        });
        PopulateUnits(EnemyLeader5, new List <int> {
            4, 4, 4, 5, 5, 5
        });
        PopulateUnits(EnemyLeader6, new List <int> {
            8, 10, 10
        });

        PlayerLeader.Connect("LeaderSelected", this, nameof(OnLeaderSelected));
        PlayerLeader.Connect("LeaderDeselected", this, nameof(OnLeaderDeselected));
        ChallengeButton.Connect("pressed", this, nameof(OnChallengeButtonPressed));
        BorrowButton.Connect("pressed", this, nameof(OnBorrowButtonPressed));
        BorrowDoneButton.Connect("pressed", this, nameof(OnBorrowDoneButtonPressed));
        SettleDebtButton.Connect("pressed", this, nameof(OnSettleDebtButtonPressed));
        SettleDebtDoneButton.Connect("pressed", this, nameof(OnSettleDebtDoneButtonPressed));
    }
Ejemplo n.º 2
0
        public void conectar_Accounts()
        {
            Leader.Connect();

            foreach (Account miembro in miembros)
            {
                miembro.Connect();
            }
        }