Beispiel #1
0
        private void Movimento()
        {
            BugsBLL.FullCombo();
            if (KeyboardUtils.GetKey("ui_select", Keystatus.Pressed) && personagemDTO.Municao != 0)
            {
                personagemDTO.Municao -= 1;
                ArmaSprite.Atirar(personagemDTO, personagemDTO.SpritePersonagem.FlipH);
            }
            if (KeyboardUtils.GetKey("ui_up", Keystatus.Pressed))
            {
                SingleMonophonicEmiterBLL.Reproduzir(JumpSound);
                BugsBLL.FlyBug = false;
                GravidadeBLL.Pular(personagemDTO);
                BugsBLL.NoCombo();
            }

            personagemDTO.Direcao.x = (Convert.ToInt32(KeyboardUtils.GetKey("ui_right", Keystatus.Hold)) - Convert.ToInt32(KeyboardUtils.GetKey("ui_left", Keystatus.Hold)));
            if (KeyboardUtils.GetKey("ui_right", Keystatus.Pressed) || KeyboardUtils.GetKey("ui_left", Keystatus.Pressed))
            {
                if (!BugsBLL.FlyBug)
                {
                    BugsBLL.Combo += 1;
                }
                Combo.Start(1);
            }

            MovimentoKinematicoBLL.Move2D(personagemDTO);
        }
 private void _on_Dev_area_entered(object area)
 {
     if ((area as Node).IsInGroup("bullet"))
     {
         SingleMonophonicEmiterBLL.Reproduzir(KillSound);
         vivo = false;
     }
 }
        public void Atirar(PersonagemDTO personagem, bool invertido)
        {
            SingleMonophonicEmiterBLL.Reproduzir(TiroSound);
            BulletController disparo = (ObjectPoolingBLL.executarPooling(bulletPool) as BulletController);
            Vector2          direcao = invertido ? new Vector2(GlobalPosition.x - 3, GlobalPosition.y) : new Vector2(GlobalPosition.x + 3, GlobalPosition.y);

            disparo.Shoot(direcao, invertido);
        }
 private void _on_Checkpoint_body_entered(object body)
 {
     if ((body as Node).IsInGroup("player") && Desativado)
     {
         SingleMonophonicEmiterBLL.Reproduzir(CheckpointSound);
         AnimationView.ExecutarAnimacao(true, "Active", PersonagemDTO);
         BugsBLL.Spawnpoint = GlobalPosition;
     }
 }
Beispiel #5
0
 private void _on_PowerUP_body_entered(object body)
 {
     if ((body as Node).IsInGroup("player"))
     {
         SingleMonophonicEmiterBLL.Reproduzir(PowerUpSound);
         SetCollisionLayerBit(0, false);
         Visible = false;
         (body as JogadorController).personagemDTO.Municao += 3;
     }
 }
 public override void _Ready()
 {
     OS.WindowMaximized = true;
     DefineListaDeNiveis();
     SingleMonophonicEmiterBLL.emissor = this;
     SingleMonophonicEmiterBLL.musica  = GetChild <AudioStreamPlayer>(0);
     SingleMonophonicEmiterBLL.Tocar(Musicas[0]);
     NivelCarregado = GetChild(1);
     MudaNivel(NivelAtual);
 }
 public override void _PhysicsProcess(float delta)
 {
     if (!personagemDTO.Vivo && personagemDTO.AnimationPlayer.CurrentAnimation != "Destruido" && personagemDTO.AnimationPlayer.CurrentAnimation != "")
     {
         SingleMonophonicEmiterBLL.Reproduzir(BoxSound);
     }
     if (!personagemDTO.Vivo)
     {
         AnimationView.ExecutarAnimacao(true, "Destruido", personagemDTO);
     }
 }
Beispiel #8
0
 private void Animar()
 {
     if (personagemDTO.Vivo && personagemDTO.AnimationPlayer.CurrentAnimation != "Hit")
     {
         AnimationView.ExecutarAnimacao(personagemDTO.Direcao == new Vector2(0, 0), "Idle", personagemDTO);
         AnimationView.ExecutarAnimacao(personagemDTO.Direcao != new Vector2(0, 0), "Walk", personagemDTO);
     }
     if (!personagemDTO.Vivo && personagemDTO.AnimationPlayer.CurrentAnimation != "Morte" && personagemDTO.AnimationPlayer.CurrentAnimation != "")
     {
         SingleMonophonicEmiterBLL.Reproduzir(KillSound);
     }
     AnimationView.ExecutarAnimacao(!personagemDTO.Vivo, "Morte", personagemDTO);
 }
Beispiel #9
0
 private void Animar()
 {
     if (personagemDTO.Vivo)
     {
         AnimationView.ExecutarAnimacao(personagemDTO.Corpo2D.IsOnFloor() && personagemDTO.Direcao.x == 0, "Idle", personagemDTO);
         AnimationView.ExecutarAnimacao(personagemDTO.Corpo2D.IsOnFloor() && personagemDTO.Direcao.x != 0, "Walk", personagemDTO);
         AnimationView.ExecutarAnimacao(!personagemDTO.Corpo2D.IsOnFloor() && !BugsBLL.FlyBug, "Jump", personagemDTO);
         AnimationView.ExecutarAnimacao(BugsBLL.FlyBug, "FlyBug", personagemDTO);
         Arma.Visible = personagemDTO.Municao != 0;
         Arma.Scale   = new Vector2(1 - (2 * Convert.ToInt32(AnimationView.Flip2D(personagemDTO))), 1);
     }
     if (!personagemDTO.Vivo && personagemDTO.AnimationPlayer.CurrentAnimation != "Morte")
     {
         SingleMonophonicEmiterBLL.Reproduzir(DieSound);
     }
     AnimationView.ExecutarAnimacao(!personagemDTO.Vivo, "Morte", personagemDTO);
 }
        public void MudaNivel(int ProximoNivel)
        {
            if (NivelCarregado.GetChildCount() > 0)
            {
                NivelCarregado.GetChild(0).QueueFree();
            }
            if (ProximoNivel != NivelAtual)
            {
                SingleMonophonicEmiterBLL.Tocar(Musicas[ProximoNivel]);
                BugsBLL.Spawnpoint = new Vector2(34.28f, 25.9883f);
                BugsBLL.FlyBug     = false;
                BugsBLL.Combo      = 0;
            }
            Node newLevel = (Node)Niveis[ProximoNivel].Instance();

            NivelCarregado.AddChild(newLevel);
            NivelAtual = ProximoNivel;
        }
Beispiel #11
0
        public override void _Process(float delta)
        {
            if (BugsBLL.Vida == 0)
            {
                Texto.Text        = "";
                TitleScreen.Frame = 4;
            }
            switch (TitleScreen.Frame)
            {
            case 0:
                if (string.IsNullOrEmpty(Texto.Text))
                {
                    TitleScreen.Frame = 1;
                }
                break;

            case 1:
                if (KeyboardUtils.GetKey("ui_left", Keystatus.Pressed) || KeyboardUtils.GetKey("ui_right", Keystatus.Pressed))
                {
                    SingleMonophonicEmiterBLL.Reproduzir(MenuSound);
                    TitleScreen.Frame = 2;
                }
                if (KeyboardUtils.GetKey("ui_accept", Keystatus.Pressed))
                {
                    SingleMonophonicEmiterBLL.Reproduzir(MenuSound);
                    Base.Portugues    = false;
                    TitleScreen.Frame = 3;
                }
                break;

            case 2:
                if (KeyboardUtils.GetKey("ui_left", Keystatus.Pressed) || KeyboardUtils.GetKey("ui_right", Keystatus.Pressed))
                {
                    SingleMonophonicEmiterBLL.Reproduzir(MenuSound);
                    TitleScreen.Frame = 1;
                }
                if (KeyboardUtils.GetKey("ui_accept", Keystatus.Pressed) || KeyboardUtils.GetKey("ui_up", Keystatus.Pressed))
                {
                    SingleMonophonicEmiterBLL.Reproduzir(MenuSound);
                    Base.Portugues    = true;
                    TitleScreen.Frame = 3;
                }
                break;

            case 3:
                if (KeyboardUtils.GetKey("ui_accept", Keystatus.Pressed) || KeyboardUtils.GetKey("ui_up", Keystatus.Pressed))
                {
                    SingleMonophonicEmiterBLL.Reproduzir(MenuSound);
                    Base.MudaNivel(1);
                }
                break;

            case 4:
                BugsBLL.Vida = 3;
                if (KeyboardUtils.GetKey("ui_accept", Keystatus.Pressed) || KeyboardUtils.GetKey("ui_up", Keystatus.Pressed))
                {
                    TitleScreen.Frame = 3;
                }
                break;

            default:
                break;
            }
        }