diff options
author | Neil Kollack <nkollack@gmail.com> | 2022-04-24 15:58:51 -0500 |
---|---|---|
committer | Neil Kollack <nkollack@gmail.com> | 2022-04-24 15:58:51 -0500 |
commit | 977086919ba3fae104153f79883e7a2347fac034 (patch) | |
tree | 0136610efca89fb8bf5ad64fef8db8dde334f323 /Assets/Scripts/RespawnPoint.cs | |
parent | 6ccdfaae6ebdebcb44ea567698985a87a5b97807 (diff) |
fix: better swing, Actor Force move, respawn sound
Diffstat (limited to 'Assets/Scripts/RespawnPoint.cs')
-rw-r--r-- | Assets/Scripts/RespawnPoint.cs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Assets/Scripts/RespawnPoint.cs b/Assets/Scripts/RespawnPoint.cs index b45ece1..2a1e52e 100644 --- a/Assets/Scripts/RespawnPoint.cs +++ b/Assets/Scripts/RespawnPoint.cs @@ -8,6 +8,7 @@ public class RespawnPoint : MonoBehaviour [SerializeField] private Sprite activatedSprite; private AudioManager _audio; + private bool activated; private void Start() { @@ -16,8 +17,9 @@ public class RespawnPoint : MonoBehaviour private void OnTriggerEnter2D(Collider2D collision) { - if (collision.gameObject.tag == "Player") + if (collision.gameObject.tag == "Player" && !activated) { + activated = true; collision.gameObject.GetComponent<Player>().spawnPoint = transform.position; gameObject.GetComponent<SpriteRenderer>().sprite = activatedSprite; _audio.Play("Checkpoint"); |