void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.tag == "boss")//Enter House { scene.areaNum = 11; scene.SceneLoad("Combat"); } if (other.gameObject.tag == "Player's House")//Enter House { scene.areaNum = 2; transform.position = new Vector3(-50.98f, 0.358f, 0.0f); } if (other.gameObject.tag == "Player's House Exit")//Exit House { scene.areaNum = 0; transform.position = new Vector3(9.035f, 6.986f, 0.0f); } if (other.gameObject.tag == "Training House")//Enter House { scene.areaNum = 2; transform.position = new Vector3(54.04f, -41.02f, 0.0f); } if (other.gameObject.tag == "Training House Exit")//Exit House { scene.areaNum = 0; transform.position = new Vector3(42.11f, 5.31f, 0.0f); } if (other.gameObject.tag == "Castle's Front House")//Enter House { scene.areaNum = 2; transform.position = new Vector3(-38.57f, 48.925f, 0.0f); } if (other.gameObject.tag == "Castle's Front House Exit")//Exit House { scene.areaNum = 0; transform.position = new Vector3(35.466f, 32.912f, 0.0f); } if (other.gameObject.tag == "Orange House")//Enter House { scene.areaNum = 2; transform.position = new Vector3(176.913f, 40.726f, 0.0f); } if (other.gameObject.tag == "Orange House Exit")//Exit House { scene.areaNum = 0; transform.position = new Vector3(60.46f, 41.32f, 0.0f); } if (other.gameObject.tag == "Blue House")//Enter House { scene.areaNum = 2; transform.position = new Vector3(214.3f, 40.726f, 0.0f); } if (other.gameObject.tag == "Blue House Exit")//Exit House { scene.areaNum = 0; transform.position = new Vector3(71.47f, 41.32f, 0.0f); } if (other.gameObject.tag == "Green House")//Enter House { scene.areaNum = 2; transform.position = new Vector3(200.12f, 57.72f, 0.0f); } if (other.gameObject.tag == "Green House Exit")//Exit House { scene.areaNum = 0; transform.position = new Vector3(65.54f, 47.18f, 0.0f); } if (other.gameObject.tag == "Forest Inside Entrance")//Enter Forest Area 1 Entrance { pstats.combatready = false; scene.areaNum = 1;//the level i want the monsters to be transform.position = new Vector3(19.769f, 5.158f, 0.0f); Debug.Log("false"); } if (other.gameObject.tag == "Forest Outside Entrance")//Exit Forest Area 1 Entrance { pstats.combatready = true; scene.areaNum = 1;//the level i want the monsters to be transform.position = new Vector3(220.00f, -26.00f, 0.0f); Debug.Log("true"); } if (other.gameObject.tag == "Forest Inside Exit")//Enter Forest Area 1 Exit { pstats.combatready = false; scene.areaNum = 0; transform.position = new Vector3(35.624f, 5.14f, 0.0f); Debug.Log("false"); } if (other.gameObject.tag == "Forest Outside Exit")//Exit Forest Area 1 Exit { pstats.combatready = true; scene.areaNum = 0; transform.position = new Vector3(276.6f, -26.00f, 0.0f); Debug.Log("true"); } if (other.gameObject.tag == "Deep Forest Entrance")//Deep Forest Entrance { pstats.combatready = true; scene.areaNum = 4;//the level i want the monsters to be transform.position = new Vector3(330.7f, 68.8f, 0.0f); Debug.Log("true"); } if (other.gameObject.tag == "Deep Forest Exit")//Deep Forest Exit { pstats.combatready = false; scene.areaNum = 0; transform.position = new Vector3(57.23f, 49.12f, 0.0f); Debug.Log("false"); } if (other.gameObject.tag == "Cave Entrance")//Cave Entrance { pstats.combatready = true; scene.areaNum = 6;//the level i want the monsters to be transform.position = new Vector3(-97.67f, 56.43f, 0.0f); Debug.Log("true"); } if (other.gameObject.tag == "Cave Exit")//Cave Exit { pstats.combatready = false; scene.areaNum = 0; transform.position = new Vector3(12.49f, 45.5f, 0.0f); Debug.Log("false"); } }
public void MainMenuYes() { scene.SceneLoad("Main Menu"); }
// Update is called once per frame void Update() { if (playerState == 1)//players turn { } else if (playerState == 0)//pets turn { petFightBack = RandomNumber(1, 10); if (petFightBack == 1) { change.text = "The monster accepts your action"; } else if (petFightBack == 2) { change.text = "The monster lets out a shriek"; tamingPercentage -= 20; } else if (petFightBack == 3 && playerAction == 1) { change.text = "The monster enjoys the food"; } else if (petFightBack == 4 && playerAction == 2) { change.text = "The monster smacks its tail on the ground"; } else if (petFightBack == 5) { change.text = "The monster breathes heavily..."; tamingPercentage -= 20; } else if (petFightBack == 6 && playerAction == 3) { change.text = "The monster accepts your respect"; } else if (petFightBack == 7 && playerAction == 3) { change.text = "The monster is insulted by your respectful action"; tamingPercentage -= 40; } else if (petFightBack == 8) { change.text = "The monster just stares at you"; tamingPercentage -= 20; } else if (petFightBack == 9) { change.text = "The monster lays its head down"; } else if (petFightBack == 10 && tamingPercentage <= 20) { change.text = "The monster charges at you"; StartCoroutine(TimeDelay(1.0f)); textTame.text = ""; Destroy(petList.clones); run = true; } else { change.text = "Your action didn't get the attention of the monster"; tamingPercentage -= 30; } playerState = 1; } textTame.text = "Taming " + tamingPercentage + "%"; if (tameSuccess == true) { for (i = 0; i < 8; i++) { if (plist.party_clones[i] == null) { petList.clones.GetComponent <SpriteRenderer>().flipX = false; plist.party_clones[i] = petList.clones; break; } } scene.SceneLoad("World"); } else if (run == true) { change.text = "You ran from the Monster"; StartCoroutine(TimeDelay(2.0f)); scene.SceneLoad("World"); } }
public void IntoWorld() { scene.SceneLoad("World"); }