Skip to content

Commit

Permalink
Bug Fixes and World Building
Browse files Browse the repository at this point in the history
  • Loading branch information
fpetrini15 committed Mar 18, 2023
1 parent 1797282 commit f23abfd
Show file tree
Hide file tree
Showing 12 changed files with 3,672 additions and 660 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ private void LateUpdate()
} else {
//hit
vertex = raycastHit2D.point;
if(raycastHit2D.collider.tag == "Player") {
Debug.Log("Player Detected. Game Over!");
}
}

vertices[vertexIndex] = vertex;

if(i > 0) {
Expand Down
24 changes: 24 additions & 0 deletions Assets/ExitGame.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ExitGame : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{

}

// Update is called once per frame
void Update()
{

}

void OnTriggerEnter2D(Collider2D other){
if(other.CompareTag("Player")){
Debug.Log("Player finished game!");
}
}
}
11 changes: 11 additions & 0 deletions Assets/ExitGame.cs.meta

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

23 changes: 11 additions & 12 deletions Assets/FinalDoor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@ public class FinalDoor : MonoBehaviour
// Start is called before the first frame update
void Start()
{

}

// Update is called once per frame
void Update()
{
if (shotByBullet){
Debug.Log("Shot by bullet");
audioSource_.Play();
this.GetComponent<SpriteRenderer>().sprite = doorOpen;
this.GetComponent<BoxCollider2D> ().enabled = false;
Expand All @@ -30,16 +29,16 @@ void Update()
endDoorKey_.SetActive(true);
}
}
void OnTriggerEnter2D(Collider2D other){
if(other.CompareTag("Bullet")){
shotByBullet = true;
}

void OnCollisionEnter2D(Collision2D other) {
if(other.gameObject.tag == "Bullet") {
shotByBullet = true;
}
}

private void OnTriggerExit2D(Collider2D other){
if(other.CompareTag("Bullet")){
shotByBullet = false;
}
void OnCollisionExit2D(Collision2D other) {
if(other.gameObject.tag == "Bullet") {
shotByBullet = false;
}

}
}
}
2 changes: 2 additions & 0 deletions Assets/FinalDoorKey.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public class FinalDoorKey : MonoBehaviour
public GameObject door_;
public Sprite doorOpen;
public bool playerIsClose;
public AudioSource audioSource_;

// Start is called before the first frame update
// void Start()
Expand All @@ -23,6 +24,7 @@ void Update()
{
door_.GetComponent<SpriteRenderer>().sprite = doorOpen;
door_.GetComponent<BoxCollider2D> ().enabled = false;
audioSource_.Play();
}
}

Expand Down
2 changes: 1 addition & 1 deletion Assets/KillGuard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void Update()
ScoreManager.instance.AdddPoints(20, -20);
pointsAdded = true;
}
if(ScoreManager.instance.GetSanityScore() <= -20) { // clean runs are rewarded
if(ScoreManager.instance.GetSanityScore() <= 0) { // clean runs are rewarded
endDoorKey_.SetActive(false);
}
}
Expand Down
2 changes: 2 additions & 0 deletions Assets/LockPick.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class LockPick : MonoBehaviour
public TMP_Text lock_pick_guy_dialogue;
public bool playerIsClose;
private bool pointsAdded = false;
public AudioSource audioSource_;

// Start is called before the first frame update
// void Start()
Expand All @@ -33,6 +34,7 @@ void Update()
NPC5_cell_door.SetActive(false);
NPC5_cell_door_2.SetActive(false);
lock_pick_guy_dialogue.text = "We're Free!";
audioSource_.Play();
if (!pointsAdded)
{
ScoreManager.instance.AdddPoints(15, 15);
Expand Down
4 changes: 2 additions & 2 deletions Assets/NextLevelDialogueScripts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ void Start()
// Update is called once per frame
void Update()
{
if (lvl2_door.GetComponent<BoxCollider2D> ().enabled == false && !doorOpened)
/*if (lvl2_door.GetComponent<BoxCollider2D> ().enabled == false && !doorOpened)
{
Debug.Log("Open Sesame");
int sanityScore = ScoreManager.instance.GetSanityScore();
Expand All @@ -30,7 +30,7 @@ void Update()
// }
doorOpened = true;
}
}*/

}
}
Loading

0 comments on commit f23abfd

Please sign in to comment.