public static void NewGamePlus() { foreach (var item in Gen_GameMaster.instance.Ali_List) { Destroy(item); } Gen_GameMaster.instance.Ali_List.Clear(); foreach (var item in Gen_GameMaster.instance.Ast_List) { Destroy(item); } foreach (GameObject o in GameObject.FindGameObjectsWithTag("Shi_Holder")) { Destroy(o); } Gen_GameMaster.instance.Gen_ItsGameOver = false; Gen_GameMaster.instance.Ast_List.Clear(); Gen_GameMaster.instance.Gen_GameOver.SetActive(false); Gen_GameMaster.instance.Gen_Pause.SetActive(false); Gen_GameMaster.instance.Gen_Life = Gen_GameMaster.instance.Gen_MaxLife; Gen_GameMaster.instance.Sco_Value = 0; Gen_Funciones.Gen_Asteroids(); //TODO Quitar!!! Sou_SoundManager.instance.Gen_PlayBackgorund(); Instantiate(Gen_GameMaster.instance.Shi_Holder); }
public static void Ast_Check() { if (Gen_GameMaster.instance.Ast_Count == 0) { Gen_GameMaster.instance.Ast_List.Clear(); Gen_Funciones.Gen_Asteroids(); } }
void OnTriggerEnter2D(Collider2D other) { if (other.tag == "Sho_Layer") { Sou_SoundManager.instance.Ast_PlayDestroy(); Gen_GameMaster.instance.Sho_CurrentShot--; Gen_GameMaster.instance.Ast_Count--; Destroy(other.gameObject); if (Ast_level == 0) { GameObject clone; clone = Instantiate(Gen_GameMaster.instance.Ast_GameObject) as GameObject; Gen_GameMaster.instance.Ast_List.Add(clone); Ast_Script aux = clone.GetComponent <Ast_Script>(); aux.Ast_level = 1; aux.Ast_Position = this.transform.position; aux.Ast_Scale = this.transform.localScale; clone = Instantiate(Gen_GameMaster.instance.Ast_GameObject) as GameObject; Gen_GameMaster.instance.Ast_List.Add(clone); aux = clone.GetComponent <Ast_Script>(); aux.Ast_level = 1; aux.Ast_Position = this.transform.position; aux.Ast_Scale = this.transform.localScale; Gen_GameMaster.instance.Sco_Value += Gen_GameMaster.instance.Ast_ScorePoints; } if (Ast_level == 1) { GameObject clone; clone = Instantiate(Gen_GameMaster.instance.Ast_GameObject) as GameObject; Gen_GameMaster.instance.Ast_List.Add(clone); Ast_Script aux = clone.GetComponent <Ast_Script>(); aux.Ast_level = 2; aux.Ast_Position = this.transform.position; aux.Ast_Scale = this.transform.localScale; clone = Instantiate(Gen_GameMaster.instance.Ast_GameObject) as GameObject; Gen_GameMaster.instance.Ast_List.Add(clone); aux = clone.GetComponent <Ast_Script>(); aux.Ast_level = 2; aux.Ast_Position = this.transform.position; aux.Ast_Scale = this.transform.localScale; Gen_GameMaster.instance.Sco_Value += Gen_GameMaster.instance.Ast_ScorePointsSmall; } if (Ast_level == 2) { Gen_GameMaster.instance.Sco_Value += Gen_GameMaster.instance.Ast_ScorePointsSmall; Gen_Funciones.Ast_Check(); } Instantiate(Gen_GameMaster.instance.Gen_Explotion, this.transform.position, Quaternion.identity); Destroy(this.gameObject); } }
void OnTriggerEnter2D(Collider2D other) { if (other.tag == "Ast_Layer" || other.tag == "Sho_AliLayer") { if (other.tag == "Sho_AliLayer") { Destroy(other.gameObject); } Gen_GameMaster.instance.Gen_Life--; Sou_SoundManager.instance.Shi_PlayDestroy(); if (Gen_GameMaster.instance.Gen_Life > 0) { Instantiate(Gen_GameMaster.instance.Shi_Holder); } else { Gen_Funciones.GameOver(); } //Gen_GameMaster.instance.Gen_GameOver.enabled =true; Instantiate(Gen_GameMaster.instance.Gen_Explotion, this.transform.position, Quaternion.identity); Destroy(this.gameObject); } }
// Update is called once per frame void Update() { if (Shi_CanShoot) { //Manejo del Movimiento de rotacion float shi_horizontal = Input.GetAxisRaw("Horizontal") * Time.deltaTime * Shi_RotationSpeed; this.transform.Rotate(new Vector3(0, 0, -shi_horizontal)); float shi_vertical = Input.GetAxisRaw("Vertical") * Shi_MovementSpeed * Shi_Force; if (shi_vertical > 0.0) { Shi_CurrentForce += this.transform.up * shi_vertical; Shi_Sprite.sprite = Shi_On; } else { Shi_Sprite.sprite = Shi_Off; } //Validacion de Velocidad Maxima if (Shi_CurrentForce.magnitude > Shi_MaxSpeed) { Shi_CurrentForce = Shi_CurrentForce.normalized * Shi_MaxSpeed; } Shi_CurrentSpeed += Shi_CurrentForce * Time.deltaTime; Shi_CurrentSpeed = Gen_Funciones.Gen_CheckWarp(Shi_CurrentSpeed); this.transform.position = Shi_CurrentSpeed; //this.transform.position += this.transform.up * shi_vertical; ShotCheck(); } //Si se quiere mas cl'asico usando los senos y cosenos JueJueJue //this.transform.position += (new Vector3 (-Mathf.Sin(this.transform.rotation.eulerAngles.z * Mathf.Deg2Rad), Mathf.Cos(this.transform.rotation.eulerAngles.z * Mathf.Deg2Rad))) * shi_vertical; }
// Update is called once per frame void Update() { this.transform.position += this.transform.right * Gen_GameMaster.instance.Ali_MaxSpeed * Time.deltaTime; this.transform.position = Gen_Funciones.Gen_CheckWarp(this.transform.position); }
public void NewGame() { Time.timeScale = 1; Gen_Funciones.NewGamePlus (); }
// Update is called once per frame void Update() { this.transform.position += this.transform.up * Ast_Speed * Time.deltaTime; this.transform.position = Gen_Funciones.Gen_CheckWarp(this.transform.position); }
// Use this for initialization void Start() { Gen_Funciones.NewGame(); }