void Update() { input = new Vector2(); input.x = InputArcade.Eixo(jogador, EEixo.HORIZONTAL); input.y = InputArcade.Eixo(jogador, EEixo.VERTICAL); Debug.Log(input); }
// Update is called once per frame void Update() { if (InputArcade.Apertou(0, EControle.AZUL)) //If Player 1 press VERDE button { SceneManager.LoadScene("MenuScene"); //Load Menu Scene } }
// Update is called once per frame void Update() { if (!sceneDelay) { if (InputArcade.Apertou(0, EControle.AZUL)) //If Player 1 press AZUL button { SceneManager.LoadScene("MenuScene"); //Load Menu Scene } if (counter >= flashSpeed) { counter = 0; toggle = !toggle; if (toggle) { press1Text.enabled = true; } else { press1Text.enabled = false; } } else { counter++; } } sceneDelayTimer += Time.deltaTime; if (sceneDelayTimer >= 0.25f) { sceneDelay = false; } }
// Update is called once per frame void Update() { if (InputArcade.Apertou(0, EControle.PRETO) || InputArcade.Apertou(1, EControle.PRETO)) { SceneManager.LoadScene("Menu"); } if (Input.GetKeyDown(KeyCode.Keypad9) || InputArcade.Apertou(0, EControle.BRANCO)) { GameObject kill = GameObject.FindWithTag("Enemy"); Destroy(kill); } if (!destroyed) { FlashIn(); } if (startLv2) { StartLv2(); } if (quest1) { Quest1(); } }
void Update() { input = new Vector2(); input.x = InputArcade.Eixo(jogador, EEixo.HORIZONTAL); input.y = InputArcade.Eixo(jogador, EEixo.VERTICAL); Debug.Log(input); //input.x = Input.GetAxis("Horizontal"); //input.y = Input.GetAxis("Vertical"); }
private void Movement() { movDirection = new Vector3(InputArcade.Eixo(0, EEixo.HORIZONTAL) * range, 0, InputArcade.Eixo(0, EEixo.VERTICAL) * range); rb.AddForce(movDirection * movSpeed * Time.deltaTime * 1000); if (movDirection != Vector3.zero) { playerDirection = movDirection.normalized; transform.rotation = Quaternion.LookRotation(movDirection); } }
void Update() { if (InputArcade.Apertou(0, EControle.AZUL) || InputArcade.Apertou(1, EControle.AZUL)) { slowedTime = !slowedTime; } Movement(); Attack(); Dash(); AntiBugWall(); EnergyBarInter(); }
private void Attack() { if (delayAttack) { if (InputArcade.Eixo(1, EEixo.VERTICAL) > 0) { Jump(); } if (InputArcade.Eixo(1, EEixo.HORIZONTAL) < 0) { if (energyBar.fillAmount >= 0.6f) { ShotAttack(); } } if (delayAA) { if (InputArcade.Eixo(1, EEixo.HORIZONTAL) > 0) { BasicAttack(); delayAA = false; } } if (InputArcade.Eixo(1, EEixo.VERTICAL) < 0) { if (energyBar.fillAmount >= 0.35f) { SpecialAttack(); } } delayAttack = false; } if (!delayAA) { countAA += Time.deltaTime; if (countAA >= 0.5f) { countAA = 0; delayAA = true; } } if (delayAttack == false) { if (InputArcade.Eixo(1, EEixo.VERTICAL) == 0 && InputArcade.Eixo(1, EEixo.HORIZONTAL) == 0) { delayAttack = true; } } }
void Update() { if (InputArcade.Apertou(0, EControle.PRETO) || InputArcade.Apertou(1, EControle.PRETO)) { SceneManager.LoadScene("Menu"); } if (Input.GetKeyDown(KeyCode.Keypad9) || InputArcade.Apertou(0, EControle.BRANCO)) { GameObject kill = GameObject.FindWithTag("Enemy"); Destroy(kill); } count += Time.deltaTime; if (count < 12) { PlayAudio(vampeta [0]); ShowText("Agora, ah… Precisamos cortar alguns funcionários júnior. Não necessariamente cortar, você pode ser criativo aí hahahaha. ", 0.07f); } if (count > 12 && count < 13) { if (!doOnce) { guideText.text = ""; Reset(); textBox.enabled = false; SpawnEnemies(); doOnce = true; } } if (count > 13) { int enemyCount = GameObject.FindGameObjectsWithTag("Enemy").Length; if (enemyCount == 0) { textBox.enabled = true; PlayAudio(vampeta [1]); ShowText("Ah? Você ainda tá vivo?... Aaah… Próxima fase.", 0.06f); count2 += Time.deltaTime; if (count2 > 5) { PlayerPrefs.SetInt("4PTopen", 1); PlayerPrefs.Save(); //GameObject.Find("DataBase").GetComponent<conexaobd>().OpenLevel(4); SceneManager.LoadScene("4PT"); } } } }
// Update is called once per frame void Update() { if (InputArcade.Apertou(0, EControle.PRETO) || InputArcade.Apertou(1, EControle.PRETO)) { SceneManager.LoadScene("Menu"); } if (Input.GetKeyDown(KeyCode.Keypad9) || InputArcade.Apertou(0, EControle.BRANCO)) { GameObject kill = GameObject.FindWithTag("Enemy"); Destroy(kill); } count += Time.deltaTime; if (count < 9) { PlayAudio(vampeta [0]); ShowText("Esses são os supervisores gerais e… Mais alguns atrasados. Quê? O trânsito aqui é… Hahahaha um inferno", 0.07f); } if (count > 9 && count < 10) { if (!doOnce) { textBox.enabled = false; guideText.text = ""; Reset(); SpawnEnemies(); doOnce = true; } } if (count > 10) { int enemyCount = GameObject.FindGameObjectsWithTag("Enemy").Length; if (enemyCount == 0) { textBox.enabled = true; PlayAudio(vampeta [1]); ShowText("Aaaaaargh. Ok, vamos fazer uma seletiva final pra decidir logo com quem vamos ficar, antes que você mate o departamento inteiro.", 0.06f); count2 += Time.deltaTime; if (count2 > 9) { PlayerPrefs.SetInt("5SFopen", 1); PlayerPrefs.Save(); //GameObject.Find("DataBase").GetComponent<conexaobd>().OpenLevel(5); SceneManager.LoadScene("5SF"); } } } }
void Update() { txt.text = "Jogador " + indiceJogador + "\n\n" + InputArcade.Apertado(indiceJogador, EControle.CIMA) + " - " + InputArcade.Apertado(indiceJogador, EControle.DIREITA) + " - " + InputArcade.Apertado(indiceJogador, EControle.BAIXO) + " - " + InputArcade.Apertado(indiceJogador, EControle.ESQUERDA) + " - " + InputArcade.Apertado(indiceJogador, EControle.VERDE) + " - " + InputArcade.Apertado(indiceJogador, EControle.VERMELHO) + " - " + InputArcade.Apertado(indiceJogador, EControle.PRETO) + " - " + InputArcade.Apertado(indiceJogador, EControle.AZUL) + " - " + InputArcade.Apertado(indiceJogador, EControle.AMARELO) + " - " + InputArcade.Apertado(indiceJogador, EControle.BRANCO) + ";"; }
// Update is called once per frame void Update() { /* if (Input.GetKeyDown (KeyCode.W) && canJump == true) * body.AddForce (new Vector2 (0, jumpforce)); */ if (InputArcade.Apertou(jogador, EControle.VERDE) == true && canJump == true) { body.AddForce(new Vector2(0, jumpforce)); } //float direction = Input.GetAxis ("HorizontalSetas"); float direction = InputArcade.Eixo(jogador, EEixo.HORIZONTAL); body.velocity = new Vector2(walkforce * direction * Time.deltaTime, body.velocity.y); if ((body.velocity.x > 0.03f) || (body.velocity.x < -0.03f)) { anim.SetInteger("State", 1); } else { anim.SetInteger("State", 0); } if (jogador == 0) { if (body.position.x > enemy.position.x) { transform.eulerAngles = new Vector3(0, 180, 0); } else { transform.eulerAngles = new Vector3(0, 0, 0); } } if (jogador == 1) { if (body.position.x < enemy.position.x) { transform.eulerAngles = new Vector3(0, 180, 0); } else { transform.eulerAngles = new Vector3(0, 0, 0); } } }
void Update() { if (!sceneDelay) { //set movement (physics) horizontal and vertical input.x = InputArcade.Eixo(jogador, EEixo.HORIZONTAL); input.y = InputArcade.Eixo(jogador, EEixo.VERTICAL); GetComponent <Rigidbody2D> ().AddForce(new Vector2(1, 0) * input.x * velocity * Time.deltaTime); GetComponent <Rigidbody2D> ().AddForce(new Vector2(0, 1) * input.y * velocity * Time.deltaTime); scoreP0 += Time.deltaTime * multiplierP0; //scoreP0 increase over time and based on multiplier SetScoreText(); //set text score on screen SetMultiplierText(); //set text multiplier on screen if (multiplierP0 > maxMultiplierP0) //if current mult. > max mult. { maxMultiplierP0 = multiplierP0; //max mult. = current mult. } if (energyBar.fillAmount < 0.2f) { energyBar.fillAmount = 0; } if (energyBar.fillAmount > 0) { if (InputArcade.Apertou(jogador, EControle.AZUL) /*&& InputArcade.Apertado (jogador, EControle.AMARELO)*/) { leftHandPosition = new Vector3(transform.position.x, transform.position.y, transform.position.z); rightHandTransform = GameObject.Find("Right Hand").GetComponent <Transform> (); rightHandPosition = new Vector3(rightHandTransform.position.x, rightHandTransform.position.y, rightHandTransform.position.z); bullet = Instantiate(Resources.Load("Bullet")) as GameObject; bullet.GetComponent <Bullet> ().setShooter(jogador); bullet.transform.position = new Vector2(rightHandPosition.x, rightHandPosition.y); bulletDirection = rightHandPosition - leftHandPosition; bulletDirectionMagnitude = bulletDirection.magnitude; bulletDirectionVersor = new Vector3(bulletDirection.x / bulletDirectionMagnitude, bulletDirection.y / bulletDirectionMagnitude, bulletDirection.z / bulletDirectionMagnitude); bullet.GetComponent <Rigidbody2D> ().AddForce(bulletDirectionVersor * bulletForce /*/ bulletDirectionMagnitude*/); //bullet.GetComponent<Rigidbody2D>().AddForce (bulletDirection * bulletForce); energyBar.fillAmount -= 0.2f; } } } sceneDelayTimer += Time.deltaTime; if (sceneDelayTimer >= 0.25f) { sceneDelay = false; } }
// Update is called once per frame void Update() { cooldownTimer += Time.deltaTime; timeToDestruct += Time.deltaTime; //if (Input.GetKeyDown (shootCode) && cooldownTimer >= cooldown) { if (InputArcade.Apertou(jogador, EControle.VERMELHO) == true && cooldownTimer >= cooldown) { Atirar(); } else { anim.SetBool("Atirando", false); } if (InputArcade.Apertou(jogador, EControle.PRETO) == true && upadoMissle == true) { ActivateMissleUp(); } }
void Update() { timePassed += Time.deltaTime; if (InputArcade.Apertou(0, EControle.PRETO) || InputArcade.Apertou(1, EControle.PRETO)) { SceneManager.LoadScene("Menu"); } if (playerCreated) { isGrounded = player.GetComponent <PlayerMovement> ().GetIsGrounded(); airborne = player.GetComponent <PlayerMovement> ().GetAirborne(); slowedTime = player.GetComponent <PlayerMovement> ().GetSlowedTime(); } if (startTutorialFinished) { count += Time.deltaTime; Introduction(); } if (quest1) { Quest1(); } if (quest2) { Quest2(); } if (quest3) { Quest3(); } if (ghostCreated) { GhostCreated(); } }
void FixedUpdate() { if (!sceneDelay) { if (counter >= flashSpeed) //if counter >= flashSpeed { counter = 0; //reset counter toggle = !toggle; //change toggle if (toggle) //if toggle = true { selector.enabled = true; //active image press1Text.enabled = true; } else //if toggle = false { selector.enabled = false; //deactive image press1Text.enabled = false; } } else //if counter < flashSpeed { counter++; //add to counter } if (delay == false) //if delay == false { timer += Time.deltaTime; //increment timer if (timer >= 0.15f) //if timer >= 0.15 secs { delay = true; //active delay timer = 0; //reset timer } } if (currentPosition == position1) //if current position = position 1 { if (InputArcade.Apertou(0, EControle.AZUL)) //if player 1 press VERDE button { SceneManager.LoadScene("GameScene"); //load Game Scene } } if (currentPosition == position2) //if current position = position 2 { if (InputArcade.Apertou(0, EControle.AZUL)) //if player 1 press VERDE button { SceneManager.LoadScene("RulesScene"); //load RulesScene } } if (currentPosition == position3) //if current position = position 3 { if (InputArcade.Apertou(0, EControle.AZUL)) //if player 1 press VERDE button { SceneManager.LoadScene("NewRankingScene"); //load RankScene } } if (delay == true) //if delay = true { input.y = InputArcade.Eixo(0, EEixo.VERTICAL); //get vertical controller currentPosition = transform.position; //get current position of the Selector Arrow if (currentPosition == position1) //if current position = position 1 { if (input.y < 0) //if player 1 press down { transform.position = position2; //change position of the Selector Arrow to position 2 delay = false; //set delay to false } } if (currentPosition == position2) //if current position = position 2 { if (input.y > 0) //if player 1 press up { transform.position = position1; //change position to position 1 delay = false; //set delay to false } if (input.y < 0) //if player 1 press down { transform.position = position3; //change position to position 3 delay = false; //set delay to false } } if (currentPosition == position3) //if current position = position 3 { if (input.y > 0) //if player 1 press up { transform.position = position2; //change position to position 2 delay = false; //set delay to false } } } } sceneDelayTimer += Time.deltaTime; if (sceneDelayTimer >= 0.25f) { sceneDelay = false; } }
private void Quest1() { if (!up && !down && !left && !right) { // ShowText ("Vai... ahn... Até ali pra eu começar\n" + // "a te avaliar.\n" + // "(Mova Joystick esquerdo pra cima \n" + // "pra andar pra frente)"); //player.GetComponent<PlayerMovement> ().enabled = true; ChangeSprite(meio, frente); if (InputArcade.Eixo(0, EEixo.VERTICAL) > 0 /*&& finishedText == true*/) { up = true; count = 0; Reset(); } } if (up) { count += Time.deltaTime; PlayAudio(vampeta [1]); ShowText("Nãnãnãnão!! Por aí não, você vai sujar todo o salão.\n" + "( esquerdo: para andar para a esquerda)", 0.07f); if (count < 3) { joystick.enabled = false; } else { joystick.enabled = true; joystick.transform.localPosition = new Vector3(-585, -380, 0); ChangeSprite(meio, esquerdo); } if (InputArcade.Eixo(0, EEixo.HORIZONTAL) < 0 && finishedText == true) { up = false; left = true; Reset(); count = 0; } } if (left) { count += Time.deltaTime; PlayAudio(vampeta [2]); ShowText("Ehrm… Se importa em dar a volta pela direita, eu… Sou supersticioso heheh… \n" + "( esquerdo: para andar para a direita)", 0.1f); if (count < 3.5f) { joystick.enabled = false; } else { joystick.enabled = true; joystick.transform.localPosition = new Vector3(-585, -380, 0); ChangeSprite(meio, direito); } if (InputArcade.Eixo(0, EEixo.HORIZONTAL) > 0 && finishedText == true) { left = false; right = true; Reset(); count = 0; } } if (right) { count += Time.deltaTime; PlayAudio(vampeta [3]); ShowText("Tá, certo. Agora vira pra cá pra eu registrar sua cara no sistema.\n" + "( esquerdo: para andar para trás)", 0.1f); if (count < 3.5f) { joystick.enabled = false; } else { joystick.enabled = true; joystick.transform.localPosition = new Vector3(-585, -380, 0); ChangeSprite(meio, tras); } if (InputArcade.Eixo(0, EEixo.VERTICAL) < 0 && finishedText == true) { right = false; down = true; Reset(); count = 0; } } if (down) { count += Time.deltaTime; if (count < 2) { joystick.enabled = false; PlayAudio(vampeta [4]); ShowText("Perfeito", 0.1f); } if (count > 2 && !doOnce) { player.GetComponent <PlayerMovement> ().enabled = false; // fazer algum efeito enquanto o ghost aparece ghost = Instantiate(Resources.Load("Ghost")) as GameObject; ghost.transform.position = new Vector3(player.transform.position.x, 6.8f, player.transform.position.z + 30); ghost.name = "Ghost"; ghost.GetComponent <Ghost> ().enabled = false; ghostCreated = true; doOnce = true; Reset(); } if (count > 3 && count < 6) { PlayAudio(vampeta [5]); ShowText(" … Pegar o espírito da coisa… Entendeu? Heheheh. ", 0.1f); } if (count > 9) { apagaTexto = true; finishedText = false; quest1 = false; quest2 = true; count = 0; playAudioOnce = false; player.GetComponent <PlayerMovement> ().enabled = true; ghost.GetComponent <Ghost> ().enabled = true; } } }
private void Quest2() { count += Time.deltaTime; if (!basicSkill && !bulletSkill && !jumpSkill && !specialSkill) { PlayAudio(vampeta [6]); ShowText("Ok, aqui você tem… Experiência em decaptação com foice, é isso?\n" + "( direito: para atacar com a foice)", 0.1f); if (count < 3) { joystick.enabled = false; } else { joystick.enabled = true; joystick.transform.localPosition = new Vector3(-585, -380, 0); ChangeSprite(meio, direito); } if (InputArcade.Eixo(1, EEixo.HORIZONTAL) > 0 && finishedText == true && isGrounded) { basicSkill = true; Reset(); count = 0; } } if (basicSkill) { if (count < 5.5f) { joystick.enabled = false; } else { joystick.enabled = true; joystick.transform.localPosition = new Vector3(-585, -380, 0); ChangeSprite(meio, esquerdo); } if (count < 2) { PlayAudio(vampeta [7]); ShowText("… Muito original.", 0.1f); //corrigir, nao saiu audio (talvez muito rapido); } if (count > 2 && count < 4) { Reset(); } if (count > 4) { PlayAudio(vampeta [8]); ShowText("Facilidade com magia negra? \n\n" + "( direito: para jogar uma esfera de energia)", 0.06f); if (InputArcade.Eixo(1, EEixo.HORIZONTAL) < 0 && finishedText == true && isGrounded) { basicSkill = false; bulletSkill = true; Reset(); count = 0; } } } if (bulletSkill) { if (count < 7) { joystick.enabled = false; } else { joystick.enabled = true; joystick.transform.localPosition = new Vector3(-585, -380, 0); ChangeSprite(meio, frente); } if (count < 2) { PlayAudio(vampeta [9]); ShowText("Uuh… Impressionante…", 0.1f); } if (count > 2 && count < 4) { Reset(); } if (count > 4) { PlayAudio(vampeta [10]); ShowText("Pu...Pulo? Hãã, quem coloca no currículo que sabe pular?!\n" + "( direito: pra pular.)", 0.1f); if (InputArcade.Eixo(1, EEixo.VERTICAL) > 0 && finishedText == true) { bulletSkill = false; jumpSkill = true; Reset(); count = 0; } } } if (jumpSkill) { if (count < 8) { joystick.enabled = false; } else { joystick.enabled = true; joystick.transform.localPosition = new Vector3(-585, -450, 0); ChangeSprite(meio, tras); } if (count < 1) { Reset(); } if (count > 1) { PlayAudio(vampeta [14]); ShowText("“Conjuração de auto entidade profana ascendente do plano“...? Isso é um tipo formal de falar “Tipo um lance do mal que sai do chão”?\n" + "( direito: para criar a barreira.)" , 0.1f); if (InputArcade.Eixo(1, EEixo.VERTICAL) < 0 && finishedText == true && isGrounded) { jumpSkill = false; quest2 = false; quest3 = true; Reset(); count = 0; } } } }
void Update() { //print("HORIZONTAL " + Input.GetAxis("HORIZONTAL0") + " VERTICAL " + Input.GetAxis("VERTICAL0")); print("BOTAO " + InputArcade.Apertado(0, EControle.DIREITA)); }
private void Dash() { if (dash.fillAmount >= 1) { // ||||||||||||||||||||||||||||||||||||||||| Dash Foward ||||||||||||||||||||||||||||||||||||||||| if (InputArcade.Eixo(0, EEixo.VERTICAL) > 0 && firstButtonPressedF && firstButtonReleasedF) { if (Time.time - timeOfFirstButtonF < 0.35f) { transform.position = new Vector3(transform.position.x, transform.position.y, transform.position.z + 20); dash.fillAmount = 0; } resetF = true; } if (InputArcade.Eixo(0, EEixo.VERTICAL) > 0 && !firstButtonPressedF) { firstButtonPressedF = true; timeOfFirstButtonF = Time.time; firstButtonPressedB = false; firstButtonReleasedB = false; firstButtonPressedL = false; firstButtonReleasedL = false; firstButtonPressedR = false; firstButtonReleasedR = false; } if (InputArcade.Eixo(0, EEixo.VERTICAL) == 0 && firstButtonPressedF) { firstButtonReleasedF = true; } if (resetF) { firstButtonPressedF = false; firstButtonReleasedF = false; resetF = false; } // ||||||||||||||||||||||||||||||||||||||||| Dash Backward ||||||||||||||||||||||||||||||||||||||||| if (InputArcade.Eixo(0, EEixo.VERTICAL) < 0 && firstButtonPressedB && firstButtonReleasedB) { if (Time.time - timeOfFirstButtonB < 0.35f) { transform.position = new Vector3(transform.position.x, transform.position.y, transform.position.z - 20); dash.fillAmount = 0; } resetB = true; } if (InputArcade.Eixo(0, EEixo.VERTICAL) < 0 && !firstButtonPressedB) { firstButtonPressedB = true; timeOfFirstButtonB = Time.time; firstButtonPressedF = false; firstButtonReleasedF = false; firstButtonPressedL = false; firstButtonReleasedL = false; firstButtonPressedR = false; firstButtonReleasedR = false; } if (InputArcade.Eixo(0, EEixo.VERTICAL) == 0 && firstButtonPressedB) { firstButtonReleasedB = true; } if (resetB) { firstButtonPressedB = false; firstButtonReleasedB = false; resetB = false; } // ||||||||||||||||||||||||||||||||||||||||| Dash Right ||||||||||||||||||||||||||||||||||||||||| if (InputArcade.Eixo(0, EEixo.HORIZONTAL) > 0 && firstButtonPressedR && firstButtonReleasedR) { if (Time.time - timeOfFirstButtonR < 0.35f) { transform.position = new Vector3(transform.position.x + 20, transform.position.y, transform.position.z); dash.fillAmount = 0; } resetR = true; } if (InputArcade.Eixo(0, EEixo.HORIZONTAL) > 0 && !firstButtonPressedR) { firstButtonPressedR = true; timeOfFirstButtonR = Time.time; firstButtonPressedB = false; firstButtonReleasedB = false; firstButtonPressedL = false; firstButtonReleasedL = false; firstButtonPressedF = false; firstButtonReleasedF = false; } if (InputArcade.Eixo(0, EEixo.HORIZONTAL) == 0 && firstButtonPressedR) { firstButtonReleasedR = true; } if (resetR) { firstButtonPressedR = false; firstButtonReleasedR = false; resetR = false; } // ||||||||||||||||||||||||||||||||||||||||| Dash Left ||||||||||||||||||||||||||||||||||||||||| if (InputArcade.Eixo(0, EEixo.HORIZONTAL) < 0 && firstButtonPressedL && firstButtonReleasedL) { if (Time.time - timeOfFirstButtonL < 0.35f) { transform.position = new Vector3(transform.position.x - 20, transform.position.y, transform.position.z); dash.fillAmount = 0; } resetL = true; } if (InputArcade.Eixo(0, EEixo.HORIZONTAL) < 0 && !firstButtonPressedL) { firstButtonPressedL = true; timeOfFirstButtonL = Time.time; firstButtonPressedB = false; firstButtonReleasedB = false; firstButtonPressedF = false; firstButtonReleasedF = false; firstButtonPressedR = false; firstButtonReleasedR = false;; } if (InputArcade.Eixo(0, EEixo.HORIZONTAL) == 0 && firstButtonPressedL) { firstButtonReleasedL = true; } if (resetL) { firstButtonPressedL = false; firstButtonReleasedL = false; resetL = false; } } if (dash.fillAmount < 1) { dash.fillAmount += Time.deltaTime / 5; } }
// Update is called once per frame void Update() { if (InputArcade.Apertou(0, EControle.PRETO) || InputArcade.Apertou(1, EControle.PRETO)) { SceneManager.LoadScene("Menu"); } if (Input.GetKeyDown(KeyCode.Keypad9) || InputArcade.Apertado(0, EControle.BRANCO)) { GameObject kill = GameObject.FindWithTag("Enemy"); Destroy(kill); } count += Time.deltaTime; if (!finished) { if (count < 13) { PlayAudio(vampeta [0]); ShowText("Bom, esse é Encostus. Ele tem indicação de alguém que você não matou aqui, e, bom, assim é normal que a gente queira ficar mais pro lado dele. Boa sorte.", 0.06f); } if (count > 13 && count < 14) { if (!doOnce) { textBox.enabled = false; guideText.text = ""; Reset(); SpawnEnemies(); doOnce = true; } } if (count > 14) { int enemyCount = GameObject.FindGameObjectsWithTag("Enemy").Length; if (enemyCount == 0) { textBox.enabled = true; PlayAudio(vampeta [1]); ShowText("Aaahcabou. A vaga é sua, parabéns. Passa no RH pra gente pegar a relação de documentos,e você começa na próxima segunda.", 0.07f); count2 += Time.deltaTime; if (count2 > 15 && count2 < 16) { Reset(); count = 0; finished = true; } } } } else { if (count > 8) { PlayAudio(vampeta [2]); ShowText("Tava esperando o que? Cena de créditos e agradecimentos? Não, seu inferno vai começar agora!", 0.08f); } if (count > 18) { SceneManager.LoadScene("Menu"); } } }
void OnTriggerStay2D(Collider2D infoCollider) //function for when hand is on spot, check if right button is pressed { if (!InputArcade.Apertou(jogador, EControle.AZUL)) { if (infoCollider.tag != "Bullet") { if (InputArcade.Apertou(jogador, EControle.VERDE)) //check if player pressed VERDE button { if (infoCollider.gameObject.tag == "Green") //if object is green { RightColor(infoCollider.gameObject); //call RightCollor function } else //if not { WrongColor(infoCollider.gameObject); //call WrongCollor function if (healthBar.fillAmount == 0) //and check if players health is zero now { GameObject.Find("Right Hand").GetComponent <RightHand> ().SaveStatsP1(); //Call function SaveStatsP1, from RightHand Script GameObject.Find("Main Camera").GetComponent <SequencesGenerator> ().SaveStatsSequenceGen(); //Call function SaveStatsSequenceGen, from SequenceGenerator Script SaveStatsP0(); //Call SaveStatsP0 function HealthBarZero(); //call HealthBarZero function } } } if (InputArcade.Apertou(jogador, EControle.VERMELHO)) //check if player pressed VERMELHO button { if (infoCollider.gameObject.tag == "Red") //if object is Red { RightColor(infoCollider.gameObject); //call RightCollor function } else //if not { WrongColor(infoCollider.gameObject); //call WrongCollor function if (healthBar.fillAmount == 0) //and check if players health is zero now { GameObject.Find("Right Hand").GetComponent <RightHand> ().SaveStatsP1(); //Call function SaveStatsP1, from RightHand Script GameObject.Find("Main Camera").GetComponent <SequencesGenerator> ().SaveStatsSequenceGen(); //Call function SaveStatsSequenceGen, from SequenceGenerator Script SaveStatsP0(); //Call SaveStatsP0 function HealthBarZero(); //call HealthBarZero function } } } if (InputArcade.Apertou(jogador, EControle.PRETO)) //PRETO { if (infoCollider.gameObject.tag == "Black") //Black { RightColor(infoCollider.gameObject); } else { WrongColor(infoCollider.gameObject); if (healthBar.fillAmount == 0) { GameObject.Find("Right Hand").GetComponent <RightHand> ().SaveStatsP1(); GameObject.Find("Main Camera").GetComponent <SequencesGenerator> ().SaveStatsSequenceGen(); SaveStatsP0(); HealthBarZero(); } } } if (InputArcade.Apertou(jogador, EControle.BRANCO)) //BRANCO { if (infoCollider.gameObject.tag == "White") //White { RightColor(infoCollider.gameObject); } else { WrongColor(infoCollider.gameObject); if (healthBar.fillAmount == 0) { GameObject.Find("Right Hand").GetComponent <RightHand> ().SaveStatsP1(); GameObject.Find("Main Camera").GetComponent <SequencesGenerator> ().SaveStatsSequenceGen(); SaveStatsP0(); HealthBarZero(); } } } if (InputArcade.Apertou(jogador, EControle.AMARELO)) //Amarelo { if (infoCollider.gameObject.tag == "Yellow") //Yellow { RightColor(infoCollider.gameObject); } else { WrongColor(infoCollider.gameObject); if (healthBar.fillAmount == 0) { GameObject.Find("Right Hand").GetComponent <RightHand> ().SaveStatsP1(); GameObject.Find("Main Camera").GetComponent <SequencesGenerator> ().SaveStatsSequenceGen(); SaveStatsP0(); HealthBarZero(); } } } // if (InputArcade.Apertou (jogador, EControle.AZUL)) { //Azul // if (infoCollider.gameObject.tag == "Blue") { //Blue // RightColor (infoCollider.gameObject); // } else { // WrongColor (infoCollider.gameObject); // if (healthBar.fillAmount == 0) { // GameObject.Find ("Right Hand").GetComponent<RightHand> ().SaveStatsP1 (); // GameObject.Find ("Main Camera").GetComponent<SequencesGenerator> ().SaveStatsSequenceGen (); // SaveStatsP0 (); // HealthBarZero (); // } // } // } } } }
void Update() { if (!sceneDelay) { if (delayP0 == false) //if delay == false { timerP0 += Time.deltaTime; //increment timer if (timerP0 >= 0.15f) //if timer >= 0.15 secs { delayP0 = true; //active delay timerP0 = 0; //reset timer } } if (delayP0 == true) //if delay = true { inputP0.y = InputArcade.Eixo(0, EEixo.VERTICAL); //get vertical controller inputP0.x = InputArcade.Eixo(0, EEixo.HORIZONTAL); if (inputP0.y > 0) { i++; if (i > 36) { i = 0; } lettersP0Text [currentLetterP0].text = Convert.ToString(alphabet [i]); delayP0 = false; } if (inputP0.y < 0) { i--; if (i < 0) { i = 36; } lettersP0Text [currentLetterP0].text = Convert.ToString(alphabet [i]); delayP0 = false; } if (inputP0.x > 0) { j++; if (j > 2) { j = 0; } for (int a = 0; a <= 36; a++) { if (Convert.ToChar(lettersP0Text [j].text) == alphabet [a]) { i = a; } } currentLetterP0 = j; delayP0 = false; } if (inputP0.x < 0) { j--; if (j < 0) { j = 2; } for (int a = 0; a <= 36; a++) { if (Convert.ToChar(lettersP0Text [j].text) == alphabet [a]) { i = a; } } currentLetterP0 = j; delayP0 = false; } } if (delayP1 == false) //if delay == false { timerP1 += Time.deltaTime; //increment timer if (timerP1 >= 0.15f) //if timer >= 0.15 secs { delayP1 = true; //active delay timerP1 = 0; //reset timer } } if (delayP1 == true) //if delay = true { inputP1.y = InputArcade.Eixo(1, EEixo.VERTICAL); //get vertical controller inputP1.x = InputArcade.Eixo(1, EEixo.HORIZONTAL); if (inputP1.y > 0) { k++; if (k > 36) { k = 0; } lettersP1Text [currentLetterP1].text = Convert.ToString(alphabet [k]); delayP1 = false; } if (inputP1.y < 0) { k--; if (k < 0) { k = 36; } lettersP1Text [currentLetterP1].text = Convert.ToString(alphabet [k]); delayP1 = false; } if (inputP1.x > 0) { l++; if (l > 2) { l = 0; } for (int a = 0; a <= 36; a++) { if (Convert.ToChar(lettersP1Text [l].text) == alphabet [a]) { k = a; } } currentLetterP1 = l; delayP1 = false; } if (inputP1.x < 0) { l--; if (l < 0) { l = 2; } for (int a = 0; a <= 36; a++) { if (Convert.ToChar(lettersP1Text [l].text) == alphabet [a]) { k = a; } } currentLetterP1 = l; delayP1 = false; } } if (InputArcade.Apertou(0, EControle.AZUL)) //if player 1 press VERDE button { ranking.addNewScore(lettersP0Text [0].text + lettersP0Text [1].text + lettersP0Text [2].text, scoreP0); ranking.addNewScore(lettersP1Text [0].text + lettersP1Text [1].text + lettersP1Text [2].text, scoreP1); ranking.saveRank(); SceneManager.LoadScene("NewRankingScene"); //load new ranking scene } if (counter >= flashSpeed) { counter = 0; toggle = !toggle; if (toggle) { press1Text.enabled = true; lettersP0Text [currentLetterP0].enabled = true; lettersP1Text [currentLetterP1].enabled = true; } else { press1Text.enabled = false; lettersP0Text [currentLetterP0].enabled = false; lettersP1Text [currentLetterP1].enabled = false; } } else { counter++; } if (lettersP0Text [0] != lettersP0Text [currentLetterP0]) { lettersP0Text [0].enabled = true; } if (lettersP0Text [1] != lettersP0Text [currentLetterP0]) { lettersP0Text [1].enabled = true; } if (lettersP0Text [2] != lettersP0Text [currentLetterP0]) { lettersP0Text [2].enabled = true; } if (lettersP1Text [0] != lettersP1Text [currentLetterP1]) { lettersP1Text [0].enabled = true; } if (lettersP1Text [1] != lettersP1Text [currentLetterP1]) { lettersP1Text [1].enabled = true; } if (lettersP1Text [2] != lettersP1Text [currentLetterP1]) { lettersP1Text [2].enabled = true; } } sceneDelayTimer += Time.deltaTime; if (sceneDelayTimer >= 0.25f) { sceneDelay = false; } }