Skip to content

Commit

Permalink
Haunted House Essentials (Borrowed From Cat & Mouse)
Browse files Browse the repository at this point in the history
- Borrowed some code from cat and mouse.
- Renamed elements to match fro ghost AI.
- Found PNG of the map.

Next steps:
- Update Navmap
- Update calibration
- Design ghost AI
- Implement sound
  • Loading branch information
IssamAbushaban committed Nov 12, 2020
1 parent 82a7a75 commit 7dab529
Show file tree
Hide file tree
Showing 9 changed files with 5,978 additions and 1,550 deletions.
34 changes: 34 additions & 0 deletions OdysseyNow/Assets/ModeDirector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ private void Awake() {
calibration.GetComponent<CalibrationDirectorNew>().afterCalibration.AddListener(StartSuperCatAndMouse);
break;
case "Haunted House":
calibration.GetComponent<CalibrationDirectorNew>().afterCalibration.AddListener(StartHauntedHouse);
break;
case "Zoo Breakout":
break;
Expand Down Expand Up @@ -105,6 +106,39 @@ private void StartSuperCatAndMouse() {
}
}

private void StartHauntedHouse()
{
calibration.SetActive(false);
var p1 = ElementSettings.FindFromNameAndTag("PlayerTarget", "Player1");
var p2 = ElementSettings.FindFromNameAndTag("PlayerTarget", "Player2");
var game = AI.transform.Find("CatAndMouse").gameObject;

var p1Input = (LocalInputManager.ControlScheme)System.Enum.Parse(typeof(LocalInputManager.ControlScheme),
PlayerPrefs.GetString("P1Input"));
var p2Input = (LocalInputManager.ControlScheme)System.Enum.Parse(typeof(LocalInputManager.ControlScheme),
PlayerPrefs.GetString("P2Input"));
if (p1Input == LocalInputManager.ControlScheme.AI)
{
p1.GetComponent<NavMeshAgent>().enabled = true;
game.GetComponent<CatAI>().enabled = true;
game.GetComponent<CatAI>().level = PlayerPrefs.GetInt("ai1");
}

if (p2Input == LocalInputManager.ControlScheme.AI)
{
p2.GetComponent<NavMeshAgent>().enabled = true;
game.GetComponent<MouseAI>().enabled = true;
game.GetComponent<MouseAI>().level = PlayerPrefs.GetInt("ai2");
}

if (p1Input == LocalInputManager.ControlScheme.AI || p2Input == LocalInputManager.ControlScheme.AI)
{
game.SetActive(true);
AI.SetActive(true);
}

}

private void StartTennis() {
calibration.SetActive(false);
var p1 = ElementSettings.FindFromNameAndTag("PlayerTarget", "Player1");
Expand Down
Loading

0 comments on commit 7dab529

Please sign in to comment.