// Use this for initialization void Start() { PlayGamesPlatform.Activate(); Social.localUser.Authenticate((bool success) => { }); milisecs = 0; mins = 0; //PlayerPrefs.DeleteAll(); moveSpeed = 15; hasLanded = true; hasJumped = false; hasBoosted = false; soundId = AudioCenter.loadSound("whosh"); hasPlayed = false; velTimer = 0; hasSet50 = false; hasSet100 = false; hasSet250 = false; hasSet500 = false; hasSet1000 = false; hasSet2500 = false; hasSet5000 = false; hasSet10000 = false; hasSet25000 = false; hasSet50000 = false; hasSet100000 = false; speedTimer = 0; lastposY = 0; gameOver = false; jumpSound = AudioCenter.loadSound("mouse2"); rb = GetComponent <Rigidbody2D> (); }
void OnCollisionEnter2D(Collision2D col) { if (col.gameObject.name != "rotate") { if (PlayerPrefs.GetInt("Mode") == 0) { Social.ReportScore(UpperMove.score0, "CgkI_4i0zvscEAIQCA", (bool success) => { }); } if (PlayerPrefs.GetInt("Mode") == 1) { Social.ReportScore(UpperMove.score1, "CgkI_4i0zvscEAIQCQ", (bool success) => { }); } if (PlayerPrefs.GetInt("Sound") == 1) { AudioCenter.playSound(soundFail); } rb.velocity = Vector2.down * 2; startGame = false; UpperMove.gameOn = false; UpperMove2.gameOn = false; } }
// Use this for initialization void Start() { rb = GetComponent <Rigidbody2D> (); soundId = AudioCenter.loadSound("jump2"); soundFail = AudioCenter.loadSound("whosh"); }
// Use this for initialization void Start() { if (PlayerPrefs.GetInt("Mode") == 1) { gameObject.GetComponent <SpriteRenderer> ().sprite = coin; soundId = AudioCenter.loadSound("coin"); } if (PlayerPrefs.GetInt("Mode") == 2) { soundId = AudioCenter.loadSound("coin"); gameObject.GetComponent <SpriteRenderer> ().sprite = coin_bw; } if (PlayerPrefs.GetInt("Mode") == 3) { soundId = AudioCenter.loadSound("cork"); gameObject.GetComponent <SpriteRenderer> ().sprite = circle_coin; } if (PlayerPrefs.GetInt("Mode") == 4) { soundId = AudioCenter.loadSound("cork"); gameObject.GetComponent <SpriteRenderer> ().sprite = circle_coin_bw; } if (PlayerPrefs.HasKey("CoinNum")) { coinnum = PlayerPrefs.GetInt("CoinNum"); } }
void OnCollisionEnter2D(Collision2D col) { if (col.gameObject.tag == "B8") { TeleportUp(); } if (col.gameObject.tag == "Yacht") { TeleportUp(); } if (col.gameObject.tag == "Fish") { TeleportUp(); } if (col.gameObject.tag == "Ship") { TeleportUp(); } if (col.gameObject.tag == "Player") { if (PlayerPrefs.GetInt("Sound") == 1) { AudioCenter.playSound(soundId); } TeleportUp(); PlayerPrefs.SetInt("CoinNum", (PlayerPrefs.GetInt("CoinNum") + 1)); } }
IEnumerator playHelperSuccessAnim() { helperSuccessAnim.SetActive(false); helperSuccessAnim.SetActive(true); AudioCenter.PlayGetItem(); yield return(null); }
// Use this for initialization void Start() { soundId = AudioCenter.loadSound("woosh2"); hasPlayed = false; timer = 0; }
public void Buying() { if (PlayerPrefs.GetInt("Bought0") == 1) { if (PlayerPrefs.GetInt("FishEq") != 0) { if (PlayerPrefs.GetInt("Sound") == 1) { AudioCenter.playSound(clickId); } PlayerPrefs.SetInt("FishEq", 0); } } else { if (PlayerPrefs.GetInt("CoinNum") >= 0) { if (PlayerPrefs.GetInt("Sound") == 1) { AudioCenter.playSound(clickId); } PlayerPrefs.SetInt("Bought0", 1); PlayerPrefs.SetInt("FishEq", 0); } } }
void Update() { transform.Translate(Vector3.up * fallSpeed * Time.deltaTime, Space.World); if (transform.position.y >= -2) { fallSpeed = 0f; } if (PlayerPrefs.GetInt("On") == 1) { hasPlayed = false; if (Input.touchCount == 1) { Touch touch = Input.GetTouch(0); float x = -1.4f + 0.95f * touch.position.x / Screen.width * 3f; transform.position = new Vector3(x, -2f, 0); } } else { if (hasPlayed == false) { if (PlayerPrefs.GetInt("Sound") == 1) { AudioCenter.playSound(soundId); } hasPlayed = true; } } }
void OnCollisionEnter2D(Collision2D col) { if (col.gameObject.name == "Player" && PlayerPrefs.GetInt("Sound") == 1 && timer >= 0.2f) { AudioCenter.playSound(soundId); } }
void OnCollisionStay2D(Collision2D col) { if (col.gameObject.tag == "Coin") { TeleportUp(); } if (col.gameObject.tag == "B8") { TeleportUp(); } if (col.gameObject.tag == "Ship") { TeleportUp(); } if (col.gameObject.tag == "Yacht") { TeleportUp(); } if (col.gameObject.tag == "Player") { if (PlayerPrefs.GetInt("Sound") == 1) { AudioCenter.playSound(soundId); } GameObject.FindGameObjectWithTag("Square").transform.localScale = new Vector3(1.8f, 0.3f, 1f); TeleportUp(); } }
public void OnTap() { sc_instruction.isVisible = true; top_bg.blackout = true; AudioCenter.playSound(GameController.soundId); GameController.scene = 3; }
void OnCollisionEnter2D(Collision2D col) { EnterDist = Vector2.Distance(transform.position, GameObject.Find("Exit").transform.position); if (EnterDist < ExitDist) { if (PlayerPrefs.GetInt("Sound") == 1) { AudioCenter.playSound(rightSound); } col.gameObject.GetComponent <SpriteRenderer> ().color = greenColor; } else { if (timer >= 1) { if (PlayerPrefs.GetInt("Sound") == 1) { AudioCenter.playSound(wrongSound); } col.gameObject.GetComponent <SpriteRenderer> ().color = redColor; } } colCount++; hasJumped = false; colName = col.gameObject.name; }
public void OnTap() { if (PlayerMovement.gameOver == true) { if (PlayerPrefs.GetInt("Sound") == 1) { AudioCenter.playSound(soundId); } if (infoScreen == false) { if (hasChanged == false) { timer = 0; infoScreen = true; hasChanged = true; } } if (infoScreen == true) { if (hasChanged == false) { timer = 0; infoScreen = false; hasChanged = true; } } } }
public void Buying() { if (PlayerPrefs.GetInt("Bought4") == 1) { if (PlayerPrefs.GetInt("FishEq") != 4) { if (PlayerPrefs.GetInt("Sound") == 1) { AudioCenter.playSound(clickId); } PlayerPrefs.SetInt("FishEq", 4); } } else { if (PlayerPrefs.GetInt("CoinNum") >= 50) { if (PlayerPrefs.GetInt("Sound") == 1) { AudioCenter.playSound(soundId); } PlayerPrefs.SetInt("CoinNum", (PlayerPrefs.GetInt("CoinNum") - 50)); PlayerPrefs.SetInt("Bought4", 1); PlayerPrefs.SetInt("FishEq", 4); } } }
// Use this for initialization void Start() { soundId = AudioCenter.loadSound("whosh"); timer = 0; hasChanged = false; infoScreen = false; }
// Use this for initialization void Start() { soundId = AudioCenter.loadSound("cash"); clickId = AudioCenter.loadSound("click2"); transform.localScale = new Vector2(Screen.width / 220, Screen.width / 120); }
public void OnTap() { if (PlayerPrefs.GetInt("Sound") == 1) { AudioCenter.playSound(soundId); } move = true; }
// Update is called once per frame void Update() { if (test) { AudioCenter.PlayCantDoThat(); test = !test; } }
public void SetHelperSad(float seconds) { helperGreyActive = true; helperGreyDuration = seconds; AudioCenter.PlayHelperPoke(); // helperBodyMaterial = helperGreyMaterial; helperBodyMaterial.SetTexture("_MainTex", helperGreyTexture); }
public void OnTap() { AudioCenter.playSound(GameController.soundId); zeroScore = false; GameController.scene = 1; top_bg.blackout = true; repeat = true; }
private void Start() { playerPre = Resources.Load <GameObject>("Prefabs/Player/Player"); player = GameObject.FindGameObjectWithTag("Player"); mainCam = Camera.main; auCenter = GetComponentInChildren <AudioCenter>(); lastIsPlane = isPlane; }
public void OnTap() { AudioCenter.playSound(GameController.soundId); mpRepeat.zeroScore = true; top_bg.blackout = true; GameController.scene = 1; }
public void OnTap() { if (PlayerPrefs.GetInt("Sound") == 1) { AudioCenter.playSound(soundId); } InfoButton.move = false; }
public void OnTap() { AudioCenter.playSound(GameController.soundId); tap_instruction.isVisible = true; GameController.scene = 1; top_bg.blackout = true; repeat = true; }
// Update is called once per frame void Update() { Debug.Log(hasPlayed); if (Input.touchCount == 1) { Touch touch = Input.GetTouch(0); float x = touch.position.x; if (x < transform.position.x) { fallSpeed = 900f; transform.Translate(Vector3.left * fallSpeed * Time.deltaTime, Space.World); } if (x == transform.position.x) { fallSpeed = 0f; transform.Translate(Vector3.left * fallSpeed * Time.deltaTime, Space.World); } if (x > transform.position.x) { fallSpeed = 900f; transform.Translate(Vector3.right * fallSpeed * Time.deltaTime, Space.World); } } if (Input.touchCount == 0) { if (Screen.width / 2 < transform.position.x) { if (hasPlayed == false) { if (PlayerPrefs.GetInt("Sound") == 1) { AudioCenter.playSound(soundId); } hasPlayed = true; } transform.position = new Vector2(Screen.width / 2, transform.position.y); } if (Screen.width / 2 == transform.position.x) { fallSpeed = 0f; transform.Translate(Vector3.left * fallSpeed * Time.deltaTime, Space.World); hasPlayed = false; } if (Screen.width / 2 > transform.position.x) { if (hasPlayed == false) { if (PlayerPrefs.GetInt("Sound") == 1) { AudioCenter.playSound(soundId); } hasPlayed = true; } transform.position = new Vector2(Screen.width / 2, transform.position.y); } } }
private void OnTriggerEnter(Collider other) { if (other.CompareTag("PlayerOnBoard")) { // Player_ID = other.GetComponentInParent<PlayerIDOnBoard>().PlayerIDOB; other.GetComponentInParent <Inventory>().Setpositon(this.gameObject); AudioCenter.PlayGetItem(); } }
// Use this for initialization void Start() { GetComponent <SpriteRenderer> ().color = color1; color = 0; platformcolor = 0; jumpSound = AudioCenter.loadSound("jump3"); playerRb = GameObject.Find("Player").GetComponent <Rigidbody2D> (); }
// Use this for initialization void Start() { soundId = AudioCenter.loadSound("pickup"); SetScore(); if (PlayerPrefs.GetInt(SceneManager.GetActiveScene().name + gameObject.name) == 1) { Destroy(this.gameObject); } }
// Use this for initialization void Start() { jumpSound = AudioCenter.loadSound("jump3"); landSound = AudioCenter.loadSound("landing"); rb = GetComponent <Rigidbody2D> (); coll = GetComponent <PolygonCollider2D> (); rb.collisionDetectionMode = CollisionDetectionMode2D.Continuous; rb.interpolation = RigidbodyInterpolation2D.Extrapolate; }