Skip to content

Commit

Permalink
Adjusted Point System + End Screen
Browse files Browse the repository at this point in the history
  • Loading branch information
uchop committed Mar 19, 2023
1 parent edf264c commit 67cb9b5
Show file tree
Hide file tree
Showing 14 changed files with 550 additions and 21 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file modified Assets/.DS_Store
Binary file not shown.
84 changes: 84 additions & 0 deletions Assets/DisplayScores.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;

public class DisplayScores : MonoBehaviour
{
private int reputation;
public TMP_Text reputationElement;

private int sanityScore;
public TMP_Text sanityScoreElement;

public TMP_Text anarchistOrPacifist;
// Start is called before the first frame update
void Start()
{

}

// Update is called once per frame
void Update()
{
reputation = ScoreManager.instance.GetReputationScore();
reputationElement.text = "Reputation: " + reputation.ToString();
sanityScore = ScoreManager.instance.GetSanityScore();
sanityScoreElement.text = "Sanity Score: " + sanityScore.ToString();

if (sanityScore <= -40)
{
if (reputation <= -40)
{
//scared
anarchistOrPacifist.text = "Heavy Anarchist";
}
else
{
//mixed
anarchistOrPacifist.text = "Moderate Anarchist";
}
}
else if (sanityScore <= -20)
{
if (reputation <= 5)
{
//mixed
anarchistOrPacifist.text = "Moderate Anarchist";
}
else
{
//neutral
anarchistOrPacifist.text = "Neutral";
}
}
else if (sanityScore <= 0)
{
if (reputation < 0)
{
//netural
anarchistOrPacifist.text = "Neutral";
}
else
{
//positive
anarchistOrPacifist.text = "Moderate Pacifist";

}
}
else
{
if (reputation <= 20)
{
//positive
anarchistOrPacifist.text = "Moderate Pacifist";
}
else
{
//very positive
anarchistOrPacifist.text = "Heavy Pacifist";
}
}

}
}
11 changes: 11 additions & 0 deletions Assets/DisplayScores.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Assets/Explosion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void Update()
lvl2_npc_dialogue_2.text = selected_dialogue_2;
if (!pointsAdded)
{
ScoreManager.instance.AdddPoints(-40, -40);
ScoreManager.instance.AdddPoints(-5, -5);
pointsAdded = true;
}

Expand Down
6 changes: 6 additions & 0 deletions Assets/FinalDoorKey.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class FinalDoorKey : MonoBehaviour
public Sprite doorOpen;
public bool playerIsClose;
public AudioSource audioSource_;
private bool pointsAdded = false;

// Start is called before the first frame update
// void Start()
Expand All @@ -24,6 +25,11 @@ void Update()
{
door_.GetComponent<SpriteRenderer>().sprite = doorOpen;
door_.GetComponent<BoxCollider2D> ().enabled = false;
if (!pointsAdded)
{
ScoreManager.instance.AdddPoints(15, 15);
pointsAdded = true;
}
audioSource_.Play();
}
}
Expand Down
2 changes: 1 addition & 1 deletion Assets/GunToKill.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ void Update()
pickUp();
if (!pointsAdded)
{
ScoreManager.instance.AdddPoints(-30, -30);
ScoreManager.instance.AdddPoints(-10, -10);
pointsAdded = true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion Assets/HammerToInjure.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void Update()
audioSource_.Play();
if (!pointsAdded)
{
ScoreManager.instance.AdddPoints(-20, -20);
ScoreManager.instance.AdddPoints(-5, -5);
pointsAdded = true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion Assets/KillGuard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void Update()
lvl2_door.GetComponent<BoxCollider2D> ().enabled = false;
if (!pointsAdded)
{
ScoreManager.instance.AdddPoints(20, -20);
ScoreManager.instance.AdddPoints(20, -15);
pointsAdded = true;
}
if(ScoreManager.instance.GetSanityScore() <= 0) { // clean runs are rewarded
Expand Down
2 changes: 1 addition & 1 deletion Assets/PrisonerShot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void Update()
Destroy(gameObject);
Destroy(lvl3_npc_dialogue);
ScoreManager.instance.PrisonerDestroyed();
ScoreManager.instance.AdddPoints(-20, -20);
ScoreManager.instance.AdddPoints(-10, -10);
}
}
void OnTriggerEnter2D(Collider2D other){
Expand Down
Loading

0 comments on commit 67cb9b5

Please sign in to comment.