Exemple #1
0
    public override void Update()
    {
        _controller.timer -= Time.deltaTime;

        if (_controller.timer <= 0)
        {
            if (shootcount < shotBeforeAttack)
            {
                ShootRoutine();
            }
            else
            {
                _controller.TransitionTo <AttackState>();
            }
        }


        if (_controller.collisions.above || _controller.collisions.below)
        {
            _controller.Velocity.y = 0;
        }

        _controller.Velocity.y += _controller.Gravity * Time.deltaTime;
        _controller.Move(_controller.Velocity * Time.deltaTime);

        TransitionToAttack();
    }
 private void MovetoPosition()
 {
     if (Vector2.Distance(_controller.transform.position, _moveTo) > 1f)
     {
         Vector2 dir = (_moveTo - (Vector2)_controller.transform.position).normalized;
         _controller.Velocity = dir * moveSpeed;
     }
     else
     {
         _controller.TransitionTo <MiniBossIdle02>();
     }
 }
Exemple #3
0
 private void UpdateRedrawMovement()
 {
     _controller.manager.setTakeDamage(true);
     if (!_isAttacking)
     {
         //Debug.Log("isAttacking: " + MathHelper.GetDistanceInX(_controller.transform.position, _startPosition));
         float targetVelocityX = _direction.x * moveSpeed.Min;
         if (MathHelper.GetDistanceInX(_controller.transform.position, _startPosition) > 0.05f)
         {
             _controller.Velocity.x = Mathf.SmoothDamp(_controller.Velocity.x, targetVelocityX, ref _velocityXSmoothing, accelerationTimeGround);
             _controller.GetState <MiniBossIdle01>().ShootRoutine();
         }
         else
         {
             _controller.TransitionTo <MiniBossIdle01>();
         }
     }
 }
Exemple #4
0
    public override void Update()
    {
        if (_controller.manager.sheild.hitShield == true)
        {
            SheildHit();
        }

        if (_IsElipseAttack)
        {
            ElipseAttack();
        }
        else
        {
            PatrolState();
        }

        ShootRoutine();

        if (_controller.manager.currentHealth == 0)
        {
            _controller.TransitionTo <DeathState>();
        }
    }