Added sounds, fixed some bugs

added a sound for the tambourine, spider web, and background music.\n- finally fixed the web animation\n- added Sir Jacques to the web animation\n- changed the way the fire point tracks the grapple
This commit is contained in:
slevy14
2023-04-19 17:24:55 -07:00
parent cb059613f9
commit 686bc2528b
19 changed files with 629 additions and 149 deletions

View File

@@ -16,6 +16,7 @@ public class TambourineBehavior : MonoBehaviour {
private GameObject player;
public bool pinned = false;
public AudioSource tambourineHitSound;
void Awake() {
@@ -40,9 +41,10 @@ public class TambourineBehavior : MonoBehaviour {
// this.gameObject.transform.position = col.transform.position;
timeLerped += Time.deltaTime;
this.gameObject.transform.position = Vector2.Lerp(this.gameObject.transform.position, collidedObject.transform.position, timeLerped/timeToLerp);
if (this.gameObject.transform.position.x == collidedObject.transform.position.x && this.gameObject.transform.position.y == collidedObject.transform.position.y) {
if (this.gameObject.transform.position.x == collidedObject.transform.position.x && this.gameObject.transform.position.y == collidedObject.transform.position.y && !pinned) {
animator.SetBool("pinned", true);
pinned = true;
tambourineHitSound.Play();
} else {
// print("pinned, but not same position: " + this.gameObject.transform.position + " / " + collidedObject.transform.position);
}