public override void _Ready()
 {
     playerZone      = GetNode <PlayerDetectionZone>("PlayerDetectionZone");
     GlobalTransform = Transform;
     velocity        = Transform.x * speed;
     player          = playerZone.player;
     //double test =  GD.RandRange(1,5);GD.Rand
     //velocity = new Vector2(1,1) * speed;
 }
Ejemplo n.º 2
0
 public override void _Ready()
 {
     _stats               = GetNode <Stats>("Stats");
     _hurtBox             = GetNode <HurtBox>("HurtBox");
     _playerDetectionZone = GetNode <PlayerDetectionZone>("PlayerDetectionZone");
     _animatedSprite      = GetNode <AnimatedSprite>("AnimatedSprite");
     _softCollision       = GetNode <SoftCollision>("SoftCollision");
     _wanderController    = GetNode <WanderController>("WanderController");
 }
Ejemplo n.º 3
0
    public override void _Ready()
    {
        stats = GetNode <Stats>("Stats");
        playerDetectionZone  = GetNode <PlayerDetectionZone>("PlayerDetectionZone");
        animatedSprite       = GetNode <AnimatedSprite>("BatAnimatedSprite");
        hurtbox              = GetNode <Hurtbox>("Hurtbox");
        softCollision        = GetNode <SoftCollision>("SoftCollision");
        wanderController     = GetNode <WanderController>("WanderController");
        blinkAnimationPlayer = GetNode <AnimationPlayer>("BlinkAnimationPlayer");
        packedBatDeathEffect = GD.Load <PackedScene>("res://Effects/EnemyDeathEffect.tscn");
        rng.Randomize();
        state = pickRandomState(randomStates);

        healthBar = GetNode <Healthbar>("Healthbar");
        healthBar.setMaxHealth(stats.getMaxHealth());
        healthBar.setHealth(stats.getCurrentHealth());
    }