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); } }
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 } }
public void Direction(BUG_DIRECTION newDirection) { direction = newDirection; }
void Awake() { direction = BUG_DIRECTION.UP; }
public void AddPlayerInput(BUG_DIRECTION direction) { playerSequence.Add(direction); }