Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Commit

Permalink
Merge branch 'Main' of https://github.com/DeanLemans/DDW-2024 into Main
Browse files Browse the repository at this point in the history
  • Loading branch information
DeanLemans committed Oct 23, 2024
2 parents ec00550 + 2f41111 commit 42fd549
Showing 1 changed file with 42 additions and 9 deletions.
51 changes: 42 additions & 9 deletions DDW-2024/Assets/Scripts/DesisionPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

public class DesisionPlayer : MonoBehaviour
{

int P_Health = 3;
int AI_Health = 3;
#region test
/*
InputAction P1Button1;
Expand Down Expand Up @@ -105,6 +106,9 @@ public void Draw()
#endregion test
bool Done;
int ai;

public float targetTime = 5.0f;

System.Random rnd = new System.Random();

public void Rock()
Expand Down Expand Up @@ -135,28 +139,57 @@ public void AI(int Player)
{
Done = true;
ai=rnd.Next(1,3);
if(Player==1 && ai == 2)
{WIN();}
else if (Player==1 && ai ==3)
{ LOSE();}
if (Player==2 && ai ==3)
{ WIN();}
if (Player == 1 && ai == 2)
{ WIN(); }
else if (Player == 1 && ai == 3)
{ LOSE(); }
else if (Player == 2 && ai == 3)
{ WIN(); }
else if (Player == 2 && ai == 1)
{ LOSE(); }
if (Player == 3 && ai == 1)
else if (Player == 3 && ai == 1)
{ WIN(); }
else if (Player == 3 && ai == 2)
{ LOSE(); }

else if (Player==1 && ai==1 || Player == 2 && ai==2 || Player ==3 && ai==3) { }

}

public void WIN()
{
SceneManager.LoadScene("win");
AI_Health = AI_Health-1;
}
public void LOSE()
{
P_Health = P_Health - 1;
SceneManager.LoadScene("lose");
}

private void Update()
{


targetTime -= Time.deltaTime;

if (targetTime <= 0.0f)
{
timerEnded();
}






}
void timerEnded()
{
//do your stuff here.
}



}


0 comments on commit 42fd549

Please sign in to comment.