Skip to content
Snippets Groups Projects
Commit 115f3ed2 authored by Bruno Meyer's avatar Bruno Meyer :cry:
Browse files

Finalizado o material

parent 2423c5cb
Branches master
No related tags found
No related merge requests found
Showing
with 172 additions and 110 deletions
......@@ -49,6 +49,7 @@
<Compile Include="Assets\cubo.js" />
<Compile Include="Assets\drone.js" />
<Compile Include="Assets\geraTerreno.js" />
<Compile Include="Assets\gui.js" />
<Compile Include="Assets\tiro.js" />
<Reference Include="UnityEngine.UI">
<HintPath>/opt/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll</HintPath>
......
<Properties>
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
<MonoDevelop.Ide.Workbench ActiveDocument="Assets\cubo.js">
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" PreferredExecutionTarget="MonoDevelop.Default" />
<MonoDevelop.Ide.Workbench ActiveDocument="Assets\codigo.js">
<Files>
<File FileName="Assets\codigo.js" Line="1" Column="1" />
<File FileName="Assets\tiro.js" Line="2" Column="1" />
<File FileName="Assets\cubo.js" Line="11" Column="36" />
<File FileName="Assets\tiro.js" Line="1" Column="1" />
<File FileName="Assets\cubo.js" Line="1" Column="1" />
<File FileName="Assets\geraTerreno.js" Line="1" Column="1" />
</Files>
</MonoDevelop.Ide.Workbench>
<MonoDevelop.Ide.DebuggingService.Breakpoints>
......
CursoUnity/Assets/14872586_1505186606174813_272850746_n.jpg

14.8 KiB

fileFormatVersion: 2
guid: a8eb79f116c144ca39763570695efe01
timeCreated: 1477056377
guid: 5e6c3dce2fb5c46d585a1194476dcf44
timeCreated: 1477521449
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
......@@ -32,22 +32,22 @@ TextureImporter:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: 1
nPOTScale: 0
wrapMode: -1
nPOTScale: 1
lightmap: 0
rGBM: 0
compressionQuality: 50
allowsAlphaSplitting: 0
spriteMode: 1
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 8
textureType: -1
buildTargetSettings: []
spriteSheet:
serializedVersion: 2
......
No preview for this file type
fileFormatVersion: 2
guid: a1bc235f236d84eff866b093e670da1b
timeCreated: 1477056242
guid: cfedd2c4635c64447994ef1d59c29115
timeCreated: 1477479263
licenseType: Free
NativeFormatImporter:
userData:
......
fileFormatVersion: 2
guid: 455c5b1cdf82a4c0fbec801e41ae1ec0
timeCreated: 1477056179
guid: 53f5f2cc5d2d5426b946c400ca2d4b7d
timeCreated: 1477524403
licenseType: Free
NativeFormatImporter:
userData:
......
#pragma strict
var jogador : GameObject;
var velocidade : float;
var tempoSpawnaVida : float;
var tempoSpawnaDrone : float;
var prefabVida : GameObject;
var prefabDrone : GameObject;
function Start () {
jogador = GameObject.Find("jogador");
//jogador.transform.GetComponent.<Renderer>().material.color=Color.red;
Cursor.lockState = 1;
//Cursor.lockState = 1;
tempoSpawnaVida = 0;
tempoSpawnaDrone = 0;
velocidade = 20;
}
function Update () {
controleJogador();
instanciaVida();
instanciaDrone();
tempoSpawnaVida-=Time.deltaTime;
tempoSpawnaDrone-=Time.deltaTime;
}
function controleJogador(){
......@@ -21,22 +32,43 @@ function controleJogador(){
Application.Quit();
if(Input.GetKey("w"))
jogador.transform.Translate(Vector3.forward*5*Time.deltaTime);
jogador.transform.Translate(Vector3.forward*velocidade*Time.deltaTime);
if(Input.GetKey("s"))
jogador.transform.Translate(Vector3.back*5*Time.deltaTime);
jogador.transform.Translate(Vector3.back*velocidade*Time.deltaTime);
if(Input.GetKey("a"))
jogador.transform.Translate(Vector3.left*5*Time.deltaTime);
jogador.transform.Translate(Vector3.left*velocidade*Time.deltaTime);
if(Input.GetKey("d"))
jogador.transform.Translate(Vector3.right*5*Time.deltaTime);
jogador.transform.Translate(Vector3.right*velocidade*Time.deltaTime);
if(Input.GetKeyDown(KeyCode.Space))
jogador.transform.GetComponent.<Rigidbody>().velocity.y+=10;
jogador.transform.Rotate(0,4*Input.GetAxis("Mouse X")*10,0);
jogador.transform.Rotate(0,4*Input.GetAxis("Mouse X")*180*Time.deltaTime,0);
}
function instanciaVida(){
if( tempoSpawnaVida <= 0 ){
tempoSpawnaVida = 5;
var auxVec : Vector3 = Vector3(50*Random.value,0,50*Random.value);
Instantiate(prefabVida,transform.position+auxVec,transform.rotation);
}
}
function instanciaDrone(){
if( tempoSpawnaDrone <= 0 ){
tempoSpawnaDrone = 10;
var auxVec : Vector3 = Vector3(50*Random.value,0,50*Random.value);
Instantiate(prefabDrone,transform.position+auxVec,Quaternion.Euler(-90,0,0));
}
}
function OnCollisionEnter(col: Collision){
if(col.transform.tag == "coracao" && gui.vidas<10){
gui.vidas++;
Destroy(col.transform.gameObject);
}
}
\ No newline at end of file
File deleted
File added
fileFormatVersion: 2
guid: c5dcddc2ae8c44b5db567d8ee8c71b18
timeCreated: 1477322187
guid: f04a649f1d80b4fb7aa7f15ca5f423f4
timeCreated: 1477324818
licenseType: Free
ModelImporter:
serializedVersion: 19
......@@ -41,7 +41,7 @@ ModelImporter:
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
optimizeMeshForGPU: 0
optimizeMeshForGPU: 1
keepQuads: 0
weldVertices: 1
secondaryUVAngleDistortion: 8
......
No preview for this file type
fileFormatVersion: 2
guid: cb56db74da35c407aa0dd08e9673bfd8
timeCreated: 1477056251
guid: 572d3bb2257064219859d20494185ae3
timeCreated: 1477525407
licenseType: Free
NativeFormatImporter:
userData:
......
......@@ -39,9 +39,9 @@ function geraTerreno(i:int, j:int){
var cresce :float = 0;
var aux :float = Random.value;
if(aux > 0.99)
if(aux > 0.999)
cresce=variabilidade;
else if(aux < 0.1)
else if(aux < 0.05)
cresce=-variabilidade;
......
#pragma strict
var coracao: Texture;
var cronometro : float;
static var vidas : int;
function Start () {
vidas = 10;
cronometro = 0;
}
function Update () {
cronometro+=Time.deltaTime;
}
function OnGUI(){
var rect : Rect;
if(vidas <= 0){
rect = Rect(Screen.width*0.25,0,Screen.width*0.5,Screen.height*0.1);
Time.timeScale = 0;
GUI.Box(rect,"Você Perdeu!");
}
else{
GUI.Box(Rect(0,Screen.height*0.9,Screen.width*0.3,Screen.height*0.1),"Tempo vivo: " + cronometro);
for(var i = 0; i < vidas; i++){
rect = Rect(Screen.width*0.1*i,0,Screen.width*0.1,Screen.height*0.1);
GUI.Label(rect,coracao);
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 13e80e59293c74bdcaf4db2768fa2503
timeCreated: 1477054441
guid: 85098388fbcd14c18b812684def1d9df
timeCreated: 1477523361
licenseType: Free
MonoImporter:
serializedVersion: 2
......
CursoUnity/Assets/heart_PNG706.png

33.1 KiB

fileFormatVersion: 2
guid: 055c8c96ded674c3cb095b6b88cfc2a7
timeCreated: 1477054692
guid: 174ef3c3434294648be8800ec0f42050
timeCreated: 1477523350
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
......@@ -32,13 +32,13 @@ TextureImporter:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: 1
nPOTScale: 0
wrapMode: -1
nPOTScale: 1
lightmap: 0
rGBM: 0
compressionQuality: 50
allowsAlphaSplitting: 0
spriteMode: 1
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
......@@ -47,7 +47,7 @@ TextureImporter:
spritePixelsToUnits: 100
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureType: -1
buildTargetSettings: []
spriteSheet:
serializedVersion: 2
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment