// Update is called once per frame void Update() { GameObject girlll = GameObject.Find("Bro"); movement_clouder gf = girlll.GetComponent <movement_clouder> (); girl = gf.girl; Vector2 offset = GetComponent <Renderer> ().material.mainTextureOffset; GameObject kapsimo = GameObject.Find("clouds"); clouder kahla = kapsimo.GetComponent <clouder> (); kamenos = kahla.kamenos; GameObject kapsimo2 = GameObject.Find("clouds_2"); clouder_2 kahla2 = kapsimo2.GetComponent <clouder_2> (); kamenos2 = kahla2.kamenos2; GameObject kapsimo3 = GameObject.Find("clouds_3"); clouder_3 kahla3 = kapsimo3.GetComponent <clouder_3> (); kamenos3 = kahla3.kamenos3; if (kamenos || kamenos2 || kamenos3 || girl) { speed = 0; } Application.targetFrameRate = 60; //Vector2 offset2 = GetComponent<Renderer>().material.mainTextureOffset; offset.x += speed * (Time.deltaTime / 10); offset.x = (offset.x) % 1; GetComponent <Renderer> ().material.mainTextureOffset = offset; }
void Update() { current_energy = PlayerPrefs.GetInt("energy"); GameObject skori = GameObject.Find("Bro"); movement_clouder keimeno = skori.GetComponent <movement_clouder> (); current_score = keimeno.total; if (current_score < 16000) { hello_text.text = "Only " + current_score + " you could do better..."; } else { hello_text.text = "Hmmm " + current_score + " your score was good..."; } 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 > 148) { pause_butt.enabled = false; GameObject nokia_3 = GameObject.Find("clouds_3"); Rigidbody2D n3 = nokia_3.GetComponent <Rigidbody2D>(); GameObject gk = GameObject.Find("To_animation"); Animator gkomenaki = gk.GetComponent <Animator>(); gkomenaki.Play("da_anim_gf"); GameObject nokiaa_1 = GameObject.Find("clouds_2"); Rigidbody2D n2 = nokiaa_1.GetComponent <Rigidbody2D>(); GameObject nokia = GameObject.Find("clouds"); 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"); } }
// Use this for initialization void Start() { player = FindObjectOfType <movement_clouder>(); GameObject bro = GameObject.Find("myAnimationBros 1"); animator_bro = bro.GetComponent <Animator> (); moving = false; }
void Start() { kamenos = false; animator = transform.GetComponent <Animator>(); GameObject skori = GameObject.Find("Bro"); movement_clouder keimeno = skori.GetComponent <movement_clouder> (); score = keimeno.Score; }
void Start() { kamenos2 = false; destroyed2 = false; animator = transform.GetComponentInChildren <Animator>(); GameObject skori = GameObject.Find("Bro"); movement_clouder keimeno = skori.GetComponent <movement_clouder> (); }
void Update() { GameObject da_laser = GameObject.Find("Laserous"); ChooseWeapon laser = da_laser.GetComponent <ChooseWeapon>(); exei_laser = laser.using_laser; GameObject skori = GameObject.Find("Bro"); movement_clouder keimeno = skori.GetComponent <movement_clouder> (); keimeno.Score = score; }
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 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 > 148) { animator.Play("Thug_Life"); erwthseis = true; my_girl(); GameObject girly = GameObject.Find("girl"); Animator girlish = girly.GetComponent <Animator>(); girlish.Play("free_da_girl"); girl = true; } // if (player_pos_x.x > 4) // { // GameObject cloudz = GameObject.Find("Clouders"); // Vector3 scale = transform.localScale; // scale.x = 1.7f; // scale.y = 1.7f; // cloudz.transform.localScale = scale; // } GameObject skori = GameObject.Find("Bro"); movement_clouder keimeno = skori.GetComponent <movement_clouder> (); current_score = keimeno.Score; GameObject fin = GameObject.Find("Initial Hello"); gkomena gf = fin.GetComponent <gkomena> (); finished = gf.finished; GameObject kapsimo = GameObject.Find("clouds"); clouder kahla = kapsimo.GetComponent <clouder> (); kamenos = kahla.kamenos; GameObject kapsimo2 = GameObject.Find("clouds_2"); clouder_2 kahla2 = kapsimo2.GetComponent <clouder_2> (); kamenos2 = kahla2.kamenos2; GameObject kapsimo3 = GameObject.Find("clouds_3"); clouder_3 kahla3 = kapsimo3.GetComponent <clouder_3> (); kamenos3 = kahla3.kamenos3; GameObject player = GameObject.Find("ControlButtons_clouder"); Touch_clouder gateController = player.GetComponent <Touch_clouder> (); mov = gateController.moving; Points.text = "Points = " + Score; if (sms) { GameObject.Find("Health Bar").GetComponent <HealthBar>().Damage(10); sms = false; } GameObject cloud3 = GameObject.Find("clouds_3"); clouder_3 c3 = cloud3.GetComponent <clouder_3> (); clouds_3 = c3.kopanhse3; GameObject cloud2 = GameObject.Find("clouds_2"); clouder_2 c2 = cloud2.GetComponent <clouder_2> (); clouds_2 = c2.kopanhse2; GameObject clouds1 = GameObject.Find("clouds"); clouder c = clouds1.GetComponent <clouder> (); clouds_1 = c.kopanhse; sc1 = c.score; sc2 = c2.score; sc3 = c3.score; total = sc1 + sc2 + sc3; Points.text = "Points = " + total; Total_Points_Clouder = total; if (total > highscore_cloud) { PlayerPrefs.SetInt("highscore_cloud", 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 (kamenos || kamenos2 || kamenos3) { animator.Play("kamenos"); GetComponent <Rigidbody2D>().AddForce(Vector2.down * 5f); GameObject.Find("Health Bar").GetComponent <HealthBar>().Damage(100); setGrand(); GameObject Floor = GameObject.Find("Floor"); Floor.GetComponent <BoxCollider2D>().isTrigger = true; } if (kopanhse || kopanhse2 || kopanhse3) { //animator.Play("Hit"); // gameObject.GetComponentInChildren<Renderer>().enabled = false; // animator.enabled = false; } if (Input.GetMouseButtonDown(0) && !pause && !mov && !sms && !changed && !thug_life && !kamenos && !kamenos2 && !kamenos3 && !finished && !erwthseis) { if (bounidi) { animator.Play("myAnimationBros 1"); } if (exei_laser) { animator.Play("Laserino"); } animator.SetTrigger("Idle"); } }