コード例 #1
0
    public void Attack(KeyCode button, Direction dir)
    {
        holdAttack = true;

        if (state != State.IDLE)
        {
            return;
        }
        attackDir = (dir == Direction.NONE) ? E.ToDirection(mgMovement.GetCurrentDirection()) : dir;
        AttackType type = (button == Controls.player_attack2) ? AttackType.STAB : AttackType.SLASH;

        attack          = GetAttack(type, attackDir);
        attackAnim      = GetAttackAnim(type, dir);
        attackAnimRight = !attackAnimRight;
    }
コード例 #2
0
ファイル: Boss.cs プロジェクト: flawlesshappiness/AssemBoss
    public void FacePlayer(bool towards)
    {
        var d = GetDirectionToPlayer();

        if (towards)
        {
            if (mgMovement.GetCurrentDirection() != d)
            {
                mgMovement.MoveDirection(d);
            }
        }
        else
        {
            if (mgMovement.GetCurrentDirection() == d)
            {
                mgMovement.MoveDirection(E.Opposite(d));
            }
        }
    }
コード例 #3
0
ファイル: Player.cs プロジェクト: flawlesshappiness/AssemBoss
 void Dash()
 {
     mgMovement.SetSpeed(speedDash);
     mgJump.SetFloating(true);
     Stun(timeDash, mgMovement.GetCurrentDirection());
     MakeInvincible(timeDash);
     dashing   = true;
     hasDashed = true;
     cdDash    = Time.time + cdbDash;
     cdDashEnd = Time.time + timeDash;
 }