Ejemplo n.º 1
0
        public void ShowParticles()
        {
            if (Global.GameMode == GameMode.Modern)
            {
                if (particles == null)
                {
                    return;
                }

                if (particlesInstance == null)
                {
                    particlesInstance = particles.Instance() as CPUParticles2D;
                    DescriptionLabel.AddChild(particlesInstance);
                }

                if (particlesInstance == null)
                {
                    return;
                }

                particlesInstance.Emitting = true;
                foreach (var child in particlesInstance.GetChildren())
                {
                    if (child is CPUParticles2D particles2D)
                    {
                        particles2D.Emitting = true;
                    }
                }
            }
            LightAnimationPlayer.Play("selected");
            LightAnimationPlayer.Seek(0f);
        }
Ejemplo n.º 2
0
 public override void _Ready()
 {
     _explosionArea      = GetNode <Area2D>("ExplosionArea");
     _lifetimeTimer      = GetNode <Timer>("LifetimeTimer");
     _particles          = GetNode <CPUParticles2D>("Particles");
     _particles.Emitting = true;
 }
Ejemplo n.º 3
0
 public override void _Ready()
 {
     ProjectilePosition = GetNode <Position2D>("Position2D");
     ShootSound         = GetNode <AudioStreamPlayer>("ShootSound");
     Sprite             = GetNode <Sprite>("Sprite");
     ExplosionParticles = GetNode <CPUParticles2D>("ExplosionParticles");
     ExplosionSound     = GetNode <AudioStreamPlayer>("ExplosionSound");
 }
Ejemplo n.º 4
0
    private void EmitBlood()
    {
        CPUParticles2D bloodParticle = (CPUParticles2D)bloodParticleScene.Instance();

        bloodParticle.Position = new Vector2(Position);
        bloodParticle.Emitting = true;
        bloodParticle.OneShot  = true;
        GetTree().Root.AddChild(bloodParticle);
    }
Ejemplo n.º 5
0
    // Called when the node enters the scene tree for the first time.
    public override void _Ready()
    {
        base._Ready();
        speechBubble = GetNode <Node2D>("SpeechBubble");

        happyParticles = GetNode <CPUParticles2D>("HappyParticles");
        madParticles   = GetNode <CPUParticles2D>("MadParticles");
        sadParticles   = GetNode <CPUParticles2D>("SadParticles");
    }
Ejemplo n.º 6
0
 public override void _Ready()
 {
     particles         = GetNode("CPUParticles2D") as CPUParticles2D;
     collision         = GetNode("CollisionShape2D") as CollisionShape2D;
     sprite            = GetNode("Sprite") as Sprite;
     extraTimeLabel    = GetNode("ExtraTimeLabel") as Label;
     destroyCheckTimer = GetNode("DestroyCheckTimer") as Timer;
     destroyCheckTimer.Stop();
     animation = GetNode("AnimationPlayer") as AnimationPlayer;
     animation.Play("waiting_pick");
 }
    public override void _Ready()
    {
        sprite         = GetNode <AnimatedSprite>("Sprite");
        sprite.Playing = true;

        muzzleParticles = GetNode <CPUParticles2D>("MuzzleParticles");
        if (muzzleParticles != null)
        {
            muzzleParticles.Emitting = true;
        }
    }
Ejemplo n.º 8
0
    // Called when the node enters the scene tree for the first time.
    public override void _Ready()
    {
        hudParticles = GetNode <CPUParticles2D>("HudParticles");

        //Grab a reffrence to all the nodes in the HUD scene
        messageLabel = GetNode <Label>("MessageLabel");
        lapTime      = GetNode <Label>("LapTime");
        startBtn     = GetNode <Button>("Start");
        exitBtn      = GetNode <Button>("Exit");
        //Hide all the HUD controls for the first start up of the game
        HideUI();
        //Show the UI nodes needed for the start menu
        LoadStartMenu();
    }
Ejemplo n.º 9
0
 public override void _Ready()
 {
     trapTimer     = GetNode <Timer>("OnOffTimer");
     trapCollider  = GetNode <CollisionShape2D>("Area2D/CollisionShape2D");
     fireParticles = GetNode <CPUParticles2D>("Area2D/CPUParticles2D");
     //Switch the trap and effects off when initialized
     trapCollider.Disabled  = true;
     fireParticles.Emitting = false;
     //Start the timer for the trap
     trapTimer.Start();
     //Connect to the timers time out in order to toggle the trap on or off
     GetNode <Timer>("OnOffTimer").Connect("timeout", this, nameof(ToggleTrap));
     GetNode <Area2D>("Area2D").Connect("body_entered", this, nameof(BodyEntered));
 }
Ejemplo n.º 10
0
    public override void _Ready()
    {
        _animatedSprite = GetNode <AnimatedSprite>("AnimatedSprite");
        _healthBar      = GetNode <TextureProgress>("/root/World/HUD/HealthBar");
        _energyBar      = GetNode <TextureProgress>("/root/World/HUD/EnergyBar");
        _bloodParticles = GetNode <CPUParticles2D>("BloodParticles");
        _gameOver       = GetNode <GameOver>("/root/World/HUD/GameOver");
        _shootSound     = GetNode <AudioStreamPlayer2D>("ShootSound");
        _ammoLabel      = GetNode <Label>("/root/World/HUD/AmmoLabel");

        _bulletScene = GD.Load <PackedScene>("res://Bullet/Bullet.tscn");

        if (Input.GetConnectedJoypads().Count > 0f)
        {
            IsInputModeController = true;
        }
    }
    public override void _Ready()
    {
        cannon             = GetNode <Position2D>("Cannon");
        animationPlayer    = GetNode <AnimationPlayer>("AnimationPlayer");
        bulletCaseParticle = GetNode <CPUParticles2D>("BulletCaseParticle");
        shootSound         = GetNode <AudioStreamPlayer2D>("ShootAudioPlayer");


        STATE_READY = new FSM.State(WeaponReadyUpdate)
        {
            Name = "Ready"
        };
        STATE_TIMEOUT = new WaitState(TimeoutDuration, STATE_READY)
        {
            Name = "Reloading"
        };
        machine = new FSM(STATE_READY);
    }
Ejemplo n.º 12
0
    public override void _Ready()
    {
        GD.Print("Player::_Ready()");
        //GD.Print(this.GetPath());
        this.StateMachine    = this.GetNode("StateMachine") as StateMachine;
        this.AnimationPlayer = this.GetNode("AnimationPlayer") as AnimationPlayer;
        this.PlayerTrail     = this.GetNode("PlayerTrail") as CPUParticles2D;
        this.PlayerBurst     = this.GetNode("PlayerBurst") as CPUParticles2D;
        this.gameManager     = GetNode <GameManager>("/root/GameManager");
        this.playerNameLabel = GetNode <Label>("BodyPivot/PlayerNameLabel");

        this.gameManager.Connect("GracePeriodExpired", this, "_on_GracePeriodExpired");
        this.Connect("PlayerDied", this.gameManager, "_on_PlayerDied");

        this.SetPlayerName();
        this.playerNameLabel.Text    = name;
        this.playerNameLabel.Visible = true;

        count++;
    }
Ejemplo n.º 13
0
 public override void _Ready()
 {
     particles          = GetNode <CPUParticles2D>("CPUParticles2D");
     particles.Emitting = true;
 }
Ejemplo n.º 14
0
    // Declare member variables here. Examples:
    // private int a = 2;
    // private string b = "text";

    // Called when the node enters the scene tree for the first time.
    public override void _Ready()
    {
        this._particles = this.GetChildren().Cast <Node>().Where(c => c is CPUParticles2D).Cast <CPUParticles2D>().First();
    }
Ejemplo n.º 15
0
 public void _ReadyPlayer()
 {
     moneyParticles = GetNode <CPUParticles2D>("MoneyParticles");
     moneyManager.Connect(nameof(MoneyManager.MoneyChanged), this, "updateMoney");
     updateMoney();
 }