public void Update() { GameObject color = GameObject.Find("color"); Image myImage = color.GetComponent <Image>(); CurrentHealth = myImage.fillAmount; current_energy = PlayerPrefs.GetInt("energy"); GameObject tot_n = GameObject.Find("Bro"); movement keimeno = tot_n.GetComponent <movement> (); if (keimeno != null) { Total_Points_Nokia = keimeno.Total_Points_Nokia; } GameObject tot_j = GameObject.Find("Bro"); movement_justin keimeno2 = tot_j.GetComponent <movement_justin> (); if (keimeno2 != null) { Total_Points_Justin = keimeno2.Total_Points_Justin; } if (CurrentHealth <= 0 && reduced == false) { decrease(); StartCoroutine(MyMethod()); } }
void Update() { GameObject bouketo = GameObject.Find("Bro"); movement_justin bounia = bouketo.GetComponent <movement_justin> (); efage_bounidi = bounia.bounidi; GameObject laseraki = GameObject.Find("Bro"); movement_justin laseria = laseraki.GetComponent <movement_justin> (); efage_laser = laseria.exei_laser; GameObject skori = GameObject.Find("Bro"); movement_justin keimeno = skori.GetComponent <movement_justin> (); keimeno.Score = score; if (just) { xtypise = true; animator.Play("hit_bro"); GameObject.Find("Health Bar").GetComponent <HealthBar>().Damage(15); // GetComponent<Rigidbody2D>().AddForce(Vector2.left*forwardSpeed*2); just = false; } }
void decrease() { GameObject tot_n = GameObject.Find("Bro"); movement keimeno = tot_n.GetComponent <movement> (); if (keimeno != null) { gTotal = gTotal + Total_Points_Nokia; PlayerPrefs.SetInt("Grand_Total", gTotal); } GameObject tot_j = GameObject.Find("Bro"); movement_justin keimeno2 = tot_j.GetComponent <movement_justin> (); if (keimeno2 != null) { gTotal = gTotal + Total_Points_Justin; PlayerPrefs.SetInt("Grand_Total", gTotal); } reduced = true; current_energy -= 1; PlayerPrefs.SetInt("energy", current_energy); }
void Update() { GameObject bieberino = GameObject.Find("Bro"); movement_justin j = bieberino.GetComponent <movement_justin> (); bieber = j.bieber; }
// Use this for initialization void Start() { player = FindObjectOfType <movement_justin>(); GameObject bro = GameObject.Find("myAnimationBros 1"); animator_bro = bro.GetComponent <Animator> (); moving = false; }
void Update() { current_energy = PlayerPrefs.GetInt("energy"); GameObject skori = GameObject.Find("Bro"); movement_justin keimeno = skori.GetComponent <movement_justin> (); current_score = keimeno.total; // if (current_score < 500) { hey_text.text = "Honey you scored " + current_score + " you are a star"; } else { hey_text.text = "Can't believe you scored " + current_score + " you made mama proud"; } // energy = PlayerPrefs.GetInt("energy"); energy_text.text = "" + energy; if (energy == 0) { Application.LoadLevel(0); } GameObject player_object = GameObject.Find("Bro"); Vector3 player_pos_x = player_object.transform.position; Vector3 temp = player_object.transform.position; temp.x = player_object.transform.position.x; player_pos_x = temp; if (player_pos_x.x > 98) { pause_butt.enabled = false; GameObject mam = GameObject.Find("ur_mama"); Animator mamamia = mam.GetComponent <Animator>(); mamamia.Play("ur_mama_an"); GameObject nokia_3 = GameObject.Find("justinos_3"); Rigidbody2D n3 = nokia_3.GetComponent <Rigidbody2D>(); GameObject nokiaa_1 = GameObject.Find("justinos_2"); Rigidbody2D n2 = nokiaa_1.GetComponent <Rigidbody2D>(); GameObject nokia = GameObject.Find("justinos"); Rigidbody2D n = nokia.GetComponent <Rigidbody2D>(); BoxCollider2D b1 = n.GetComponent <BoxCollider2D> (); BoxCollider2D b2 = n2.GetComponent <BoxCollider2D> (); BoxCollider2D b3 = n3.GetComponent <BoxCollider2D> (); b1.enabled = false; b2.enabled = false; b3.enabled = false; StartCoroutine("wat2"); } }
void Start() { destroyed3 = false; animator = transform.GetComponentInChildren <Animator>(); animator.Play("justinos"); GameObject skori = GameObject.Find("Bro"); movement_justin keimeno = skori.GetComponent <movement_justin> (); }
void Start() { GameObject skori = GameObject.Find("Bro"); movement_justin keimeno = skori.GetComponent <movement_justin> (); score = keimeno.Score; animator = transform.GetComponentInChildren <Animator>(); animator.Play("justinos"); }
void Update() { Renderer rend = glasses.GetComponent <Renderer>(); Renderer rend2 = hat.GetComponent <Renderer>(); if (using_glasses == 1) { rend.enabled = true; } else { rend.enabled = false; } if (using_hat == 1) { rend2.enabled = true; } else { rend2.enabled = false; } GameObject vel = GameObject.Find("Da_instructions"); Animator velakia = vel.GetComponent <Animator> (); // if(first_time == 0){ if (velakia.GetCurrentAnimatorStateInfo(0).IsName("idle_instr") && !finished) { Time.timeScale = 0.0f; instruct = true; velakia.Play("use_instruction"); } if (Input.GetMouseButtonDown(0) && velakia.GetCurrentAnimatorStateInfo(0).IsName("use_instruction")) { velakia.Play("change"); } if (Input.GetMouseButtonDown(0) && velakia.GetCurrentAnimatorStateInfo(0).IsName("change")) { velakia.Play("anywhere"); } if (Input.GetMouseButtonDown(0) && velakia.GetCurrentAnimatorStateInfo(0).IsName("anywhere")) { velakia.Play("idle_instr"); Time.timeScale = 1.0f; instruct = false; finished = true; first_time = 1; PlayerPrefs.SetInt("ft", first_time); } //} energy = PlayerPrefs.GetInt("energy"); energy_text.text = "" + energy; if (energy == 0) { Application.LoadLevel(0); } GameObject skori = GameObject.Find("Bro"); movement_justin keimeno = skori.GetComponent <movement_justin> (); current_score = keimeno.Score; GameObject player_object = GameObject.Find("myAnimationBros 1"); Vector3 player_pos_x = player_object.transform.position; Vector3 temp = player_object.transform.position; temp.x = player_object.transform.position.x; player_pos_x = temp; if (player_pos_x.x > 98) { animator.Play("Thug_Life"); erwthseis = true; GameObject girly = GameObject.Find("home"); Animator girlish = girly.GetComponent <Animator> (); girlish.Play("mama_animation"); mama = true; } GameObject nokia_3 = GameObject.Find("justinos_3"); justin_3 n3 = nokia_3.GetComponent <justin_3> (); justin_3 = n3.just; GameObject nokia_1 = GameObject.Find("justinos_2"); justin_1 n1 = nokia_1.GetComponent <justin_1> (); justin_1 = n1.just; GameObject nokia = GameObject.Find("justinos"); justin n = nokia.GetComponent <justin> (); nok = n.just; sc1 = n1.score; sc2 = n.score; sc3 = n3.score; total = sc1 + sc2 + sc3; Points.text = "Points = " + total; if (bieber) { animator.Play("bieber_hit"); animator.SetTrigger("Idle"); bieber = false; } GameObject player = GameObject.Find("ControlButtons"); Touch_justin gateController = player.GetComponent <Touch_justin> (); mov = gateController.moving; GameObject destroyed = GameObject.Find("justinos"); justin efage_bounidi = destroyed.GetComponent <justin> (); destr = efage_bounidi.destroyed; if (total > highscore_justin) { PlayerPrefs.SetInt("highscore_justin", total); } Total_Points_Justin = total; GameObject change = GameObject.Find("Laserous"); ChooseWeapon l = change.GetComponent <ChooseWeapon>(); changed = l.change_weapon; GameObject da_laser = GameObject.Find("Laserous"); ChooseWeapon laser = da_laser.GetComponent <ChooseWeapon>(); exei_laser = laser.using_laser; GameObject using_punch = GameObject.Find("Laserous"); ChooseWeapon bounia = using_punch.GetComponent <ChooseWeapon>(); bounidi = bounia.using_punch; if (Input.GetMouseButtonDown(0) && !mov && !nok && !changed && !pause && !thug_life && !instruct && !erwthseis) { if (bounidi) { animator.Play("myAnimationBros 1"); } if (exei_laser) { animator.Play("Laserino"); } animator.SetTrigger("Idle"); } if (nok || justin_1 || justin_3) { bieber = true; } }