/// <summary> /// In the event of no input, clash away from enemy and break combo or fall if in the air /// </summary> void sendNoInput() { //Null Attack if (currentEnemy != null && !haveAttacked) { attackInput = attackInputs.None; //if (!currentEnemy.CheckInput(attackInput)) //{ // // Clash(); // currentEnemy = null; //} } haveAttacked = true; //Null Move //if not grounded and you haven't moved or mashing move if (!grounded && !haveMoved) { lerpDestination = new Vector2(transform.position.x, transform.position.y - lerpDistance); AudioMan.instance.AddClipToLiveQueue(fall); } if (mashingMove > 0) { mashingMove--; } }
// Update is called once per frame void Update() { //Attack //Raycast to enemy if (Input.GetButtonDown("AButton") || Input.GetButtonDown("BButton") || Input.GetButtonDown("XButton") || Input.GetButtonDown("YButton") || (Input.GetButtonDown("Submit"))) { Debug.Log("Input"); //currentEnemy = rayHit.transform.gameObject.GetComponent<BlaneComboScript>(); CombatInput(); attackInput = attackInputs.None; } }
public bool CheckInput(attackInputs input) { Debug.Log(currentCombo.Peek().atkInput); //Reset on mess up if (input == attackInputs.Garbage) { ResetQueue(); return(false); } else { //if (input == currentCombo.Peek()) //{ // currentCombo.Dequeue(); // shake = 0.05f; // OGPos = transform.position; // lettersLeft--; // if (lettersLeft == 1) // { // letter3.GetComponent<MeshRenderer>().enabled = false; // } // if (lettersLeft == 2) // { // letter2.GetComponent<MeshRenderer>().enabled = false; // } // if (lettersLeft == 3) // { // letter1.GetComponent<MeshRenderer>().enabled = false; // } //} //else //{ // ResetQueue(); // return false; //} //if (currentCombo.Count == 0) //{ // Destroy(gameObject); // return true; //} return(true); } }
// Use this for initialization void Start() { //Layermask for platforms, used for raycasting platformLayerMask = LayerMask.GetMask("Platform"); enemyLayerMask = LayerMask.GetMask("Enemy"); nodes = GameObject.FindGameObjectsWithTag("Nodes"); colliderBox = GetComponent <BoxCollider2D>(); box = new Rect(colliderBox.bounds.min.x, colliderBox.bounds.min.y, colliderBox.bounds.size.x, colliderBox.bounds.size.y); lerpDestination = transform.position; attackInput = attackInputs.None; BeatMan.startBeat += Reset; BeatMan.endBeat += sendNoInput; checks = GameObject.FindGameObjectsWithTag("Checkpoint"); spikes = GameObject.FindGameObjectsWithTag("Spikes"); finish = GameObject.FindWithTag("Finish"); startPos = transform.position; checkpointPos = startPos; mashingMove = 0; foreach (Transform child in transform) { switch (child.name) { case "Top Node": top = child.gameObject; break; case "Bottom Node": bottom = child.gameObject; break; case "Right Node": right = child.gameObject; break; case "Left Node": left = child.gameObject; break; } } }
/// <summary> /// Reset controls at the end of the beat /// </summary> void Reset() { haveAttacked = false; attackInput = attackInputs.None; haveMoved = false; if (mashingMove == 0) { shake = 0f; } else { mashingMove--; } if (beatCycleNum <= 2) { beatCycleNum++; } else { beatCycleNum = 0; } }
public ButtonLetter(GameObject Sp, attackInputs input) { sprite = Sp; atkInput = input; }
public AttackInputWrapper(attackInputs input) { thisInput = input; SetLetterArbitrarily(); }
// Use this for initialization void Start() { attackInput = attackInputs.None; }
void CombatInput() { //See if there is combat input //If multiple inputs, Garbage Input if (Input.GetButtonDown("AButton")) { if (attackInput == attackInputs.None) { attackInput = attackInputs.A; } else { attackInput = attackInputs.Garbage; } } if (Input.GetButtonDown("BButton")) { if (attackInput == attackInputs.None) { attackInput = attackInputs.B; } else { attackInput = attackInputs.Garbage; } } if (Input.GetButtonDown("XButton")) { if (attackInput == attackInputs.None) { attackInput = attackInputs.X; } else { attackInput = attackInputs.Garbage; } } if (Input.GetButtonDown("YButton")) { if (attackInput == attackInputs.None) { attackInput = attackInputs.Y; } else { attackInput = attackInputs.Garbage; } } if (Input.GetButtonDown("Submit")) { if (attackInput == attackInputs.None) { attackInput = attackInputs.Garbage; } } if (currentEnemy.GetComponent <ComboScript>().CheckInput(attackInput)) { //clash code here //Clash(); //currentEnemy = null; Debug.Log("Correct Input"); } }