Skip to content
Snippets Groups Projects
Commit 08fb7bc9 authored by ojsj18's avatar ojsj18 :speech_balloon:
Browse files

menu pause completo,mecanica dos abrcos, e explosão

parent 7bd8b75d
Branches
No related tags found
No related merge requests found
Showing
with 168 additions and 9 deletions
...@@ -65,6 +65,7 @@ ...@@ -65,6 +65,7 @@
<Compile Include="Assets\Scripts\Menu\onda.cs" /> <Compile Include="Assets\Scripts\Menu\onda.cs" />
<Compile Include="Assets\Scripts\Menu\texture2D.cs" /> <Compile Include="Assets\Scripts\Menu\texture2D.cs" />
<Compile Include="Assets\Scripts\MoveBarco\Instanciador.cs" /> <Compile Include="Assets\Scripts\MoveBarco\Instanciador.cs" />
<Compile Include="Assets\Scripts\MoveBarco\PauseScript2.cs" />
<Compile Include="Assets\Scripts\MoveBarco\bombmove.cs" /> <Compile Include="Assets\Scripts\MoveBarco\bombmove.cs" />
<Compile Include="Assets\Scripts\MoveBarco\capangamove.cs" /> <Compile Include="Assets\Scripts\MoveBarco\capangamove.cs" />
<Compile Include="Assets\Scripts\MoveBarco\move.cs" /> <Compile Include="Assets\Scripts\MoveBarco\move.cs" />
...@@ -74,6 +75,8 @@ ...@@ -74,6 +75,8 @@
<Compile Include="Assets\Scripts\MoveBarco\rotate.cs" /> <Compile Include="Assets\Scripts\MoveBarco\rotate.cs" />
<Compile Include="Assets\Scripts\MoveBarco\spawn.cs" /> <Compile Include="Assets\Scripts\MoveBarco\spawn.cs" />
<Compile Include="Assets\Scripts\MoveBarco\spawncapanga.cs" /> <Compile Include="Assets\Scripts\MoveBarco\spawncapanga.cs" />
<Compile Include="Assets\Scripts\MoveBarco\textHandler2.cs" />
<Compile Include="Assets\Scripts\MoveBarco\textInitHandler2.cs" />
<Reference Include="UnityEngine.Advertisements"> <Reference Include="UnityEngine.Advertisements">
<HintPath>/opt/Unity/Editor/Data/UnityExtensions/Unity/Advertisements/UnityEngine.Advertisements.dll</HintPath> <HintPath>/opt/Unity/Editor/Data/UnityExtensions/Unity/Advertisements/UnityEngine.Advertisements.dll</HintPath>
</Reference> </Reference>
......
No preview for this file type
...@@ -3,17 +3,34 @@ using System.Collections.Generic; ...@@ -3,17 +3,34 @@ using System.Collections.Generic;
using UnityEngine; using UnityEngine;
//script porco feito pelo Ovidio //script porco feito pelo Ovidio
public class anim : MonoBehaviour { public class anim : MonoBehaviour {
private Animator bombex; private Animator bombex;
public float timer = 8.0f; //tempo pra explodir
public float TE = 3.0f; //tempo pra sumir
void Start () void Start ()
{ {
bombex = GetComponent<Animator> (); bombex = GetComponent<Animator> ();
GetComponent<CapsuleCollider2D> ().enabled = false;
}
void Update ()
{
timer -= Time.deltaTime;
if (timer <= 0.0f)
{
teste ();
} }
void OnCollisionEnter2D (Collision2D Collider) { //void para uso de colliders
if (Collider.gameObject.tag == "capanga") { //acessa os colliders atraves das tags dadas
bombex.SetBool ("tocar", true); //acessa a variavel da animação e muda o estado da condição
Destroy(gameObject, 1); //destroi o objeto
Handheld.Vibrate (); //testevibração
} }
void teste()
{
bombex.SetBool ("tocar", true);
Destroy(gameObject, TE);
Handheld.Vibrate ();
GetComponent<CapsuleCollider2D> ().enabled = true;
} }
} }
\ No newline at end of file
File added
fileFormatVersion: 2
guid: 41f33d10942fe47f0882c465cd95d78b
timeCreated: 1540987738
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
File added
fileFormatVersion: 2
guid: 7703b5e0291d14e43839449ca274b1b6
timeCreated: 1539614643
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class PauseScript2 : MonoBehaviour {
void Start()
{
// faz o menu de pause nao aparecer no inicio
gameObject.SetActive (false);
}
// pausa o jogo (!)
public void Pause ()
{
// faz o menu de pause aparecer
gameObject.SetActive (true);
// tira o time do jogo
Time.timeScale = 0f;
}
public void Despause()
{
// faz o menu de pause desaparecer
gameObject.SetActive (false);
//despausa o jogo (voltando com o time)
Time.timeScale = 1;
}
public void RestartScene()
{
SceneManager.LoadScene(SceneManager.GetActiveScene().name);
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: f6ff0d4bc1fe146599a68f996589fbf2
timeCreated: 1539006771
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
...@@ -13,10 +13,10 @@ public class move: MonoBehaviour ...@@ -13,10 +13,10 @@ public class move: MonoBehaviour
void Update () void Update ()
{ {
Vector3 dir = Vector3.zero; Vector3 dir = Vector3.zero;
dir.z = Input.acceleration.x; dir.z =(Input.acceleration.x);
if (dir.z > 0 || dir.z < 0) { if (dir.z > 0 || dir.z < 0) {
float angulo = vel * Time.deltaTime * dir.z; float angulo = -1* vel * Time.deltaTime * dir.z;
if ((acumulado + angulo) >= limite_angular || (acumulado + angulo) <= -limite_angular) if ((acumulado + angulo) >= limite_angular || (acumulado + angulo) <= -limite_angular)
angulo = 0; angulo = 0;
acumulado += angulo; acumulado += angulo;
......
/**************************************************/
/* Script porco desenvolvido pela porca da Letícia
/* Feito para uso do PET Computação
/* para o projeto JAPA
/* Esse script tem como função principal cuidar
/* da renderização do textp (vitória/perda)
/**************************************************/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class textHandler2 : MonoBehaviour {
private UnityEngine.UI.Text textT;
// Use this for initialization
void Start () {
textT = this.GetComponent<UnityEngine.UI.Text>();
if (PlayerPrefs.GetInt("ScoreMasks") < 100)
{
textT.text = ("Que pena!! Tente novamente!!");
}
}
}
fileFormatVersion: 2
guid: 39b6e4893ce5942f2a41eb9f127b760c
timeCreated: 1539779562
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class textInitHandler2 : MonoBehaviour {
private bool clicado;
private UnityEngine.UI.Text textT;
private GameObject texto;
// Use this for initialization
void Start () {
clicado = false;
}
// Update is called once per frame
public void Click (string sceneName) {
if (!clicado)
{
clicado = true;
texto = GameObject.Find("Canvas/Habacuque/Discurso");
textT = texto.GetComponent<UnityEngine.UI.Text>();
textT.text = ("Use seus movimentos para equilibrar o barco e jogar todas as bombas para fora antes que elas explodão, e sem deixar nossos barris de laranja irem juntos!! Pronto pra essa aventura Pirata?");
texto = GameObject.Find("Canvas/Jogar/Text");
textT = texto.GetComponent<UnityEngine.UI.Text>();
textT.text = ("Jogar");
}
else
{
SceneManager.LoadScene(sceneName);
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment