Single Tech Games

juego fisica unity 2d

Tutorial de Unity 3D (5.x) – Haciendo un juego usando físicas 7

Hola gente! Nuevo vídeo ya nos falta poco para terminar la serie, no hay mucho que decir ahora vamos a dejar todo listo para trabajar con las físicas de Unity en el siguiente vídeo, buenpo también les dejo unos vídeos que me gustaron del GDC Vault:
http://www.gdcvault.com/play/1020866/Game-a-Week-How-to
http://www.gdcvault.com/play/1020859/How-to-Get-Your-Game
Y uno que me recomendó Claudio Ficara que está muy bueno también, y en su momento se hizo viral:
https://www.youtube.com/watch?v=Fy0aCDmgnxg

Código
LeonScript

-
-
	public Nivel1Script nivel;
-
-
	public void ejecutarKeyFrame(int key)
	{
		if(key==1)
			animador.SetBool("Explosion",true);
		if(key==2){
			nivel.juegoTerminoEnExito = true;
			this.gameObject.SetActive(false);
		}
	}

MenuScript

using UnityEngine;
using System.Collections;
public class MenuScript : MonoBehaviour {
	public int puntajeNivel1;
	public int puntajeNivel2;
	public int estrellasNivel1;
	public int estrellasNivel2;
	public Animator[] animEstrellasNvl1;
	public Animator[] animEstrellasNvl2;
	void Start()
	{
		//		PlayerPrefs.DeleteAll();
		puntajeNivel1 = PlayerPrefs.GetInt("puntajeNivel1");
		puntajeNivel2 = PlayerPrefs.GetInt("puntajeNivel2");
		estrellasNivel1 = PlayerPrefs.GetInt("estrellasNivel1");
		estrellasNivel2 = PlayerPrefs.GetInt("estrellasNivel2");
		for(int i = 0; i < estrellasNivel1; i++)
		{
			animEstrellasNvl1[i].SetBool("Pintar",true);
		}
		for(int i = 0; i < estrellasNivel2; i++)
		{
			animEstrellasNvl2[i].SetBool("Pintar",true);
		}
	}
	public void cargarEscena(string escena)
	{
		Application.LoadLevel(escena);
	}
}

FlappyScript

-
-
	public Nivel1Script nivel;
-
-
              void FixedUpdate () {
		if(GetComponent<Rigidbody2D>().velocity.x == 0 &
		   GetComponent<Rigidbody2D>().velocity.y == 0)
		{
			nivel.juegoTerminoEnFallo = true;
		}
	}

Proyecto
https://app.box.com/s/wg2krt25rudbh75sg2yfh3gpqyuoigil
Suerte!

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments