コード例 #1
0
    void NewDirection(BUG_DIRECTION pressed)
    {
        BUG_DIRECTION keyNeeded = inputSequenceScript.bugSequence[inputSequenceScript.playerSequence.Count];

        if (pressed == keyNeeded)
        {
            aliceScript.isAttacking = true;
            inputSequenceScript.playerSequence.Add(pressed);
            if (inputSequenceScript.playerSequence.Count.Equals(inputSequenceScript.bugSequence.Count))
            {
                aliceScript.Say("getFucked");
                theGame.BugKilled();
                StartCoroutine(ClearSequence());
            }
        }
        else
        {
            aliceScript.isAttacking = false;
            inputSequenceScript.playerSequence.Clear();
            healthPool.TakeDamage(1);
        }
    }
コード例 #2
0
    void NewDirection(BUG_DIRECTION pressed)
    {
        BUG_DIRECTION keyNeeded = bugInputSequence.bugSequence [bugInputSequence.playerSequence.Count];

        if (pressed == keyNeeded)
        {
            aliceScript.isAttacking = true;
            bugInputSequence.playerSequence.Add(pressed);

            if (bugInputSequence.playerSequence.Count.Equals(bugInputSequence.bugSequence.Count))
            {
                BugScript bugScript = bugs [0].GetComponent <BugScript> ();
                bugScript.Kill(this);
                aliceScript.DefeatedEnemy();
                bugDying = true;
            }
        }
        else
        {
            // Player entered wrong arrow, reset input
            aliceScript.ResetAttack();
            // TODO: play bad input sound here
        }
    }
コード例 #3
0
 public void Direction(BUG_DIRECTION newDirection)
 {
     direction = newDirection;
 }
コード例 #4
0
 void Awake()
 {
     direction = BUG_DIRECTION.UP;
 }
コード例 #5
0
 public void AddPlayerInput(BUG_DIRECTION direction)
 {
     playerSequence.Add(direction);
 }