]> git.lizzy.rs Git - SuperMouseAdventure.git/blobdiff - 2DGame/Assets/Scripts/Maus/Checkpoint.cs
Checkpoint-System v0.2
[SuperMouseAdventure.git] / 2DGame / Assets / Scripts / Maus / Checkpoint.cs
index b11f7a94e2803b5caa7b9ceb9d19325817806f80..7064863b4f9ea60ec36310d71f048ed7a5a22f3f 100644 (file)
@@ -6,6 +6,9 @@ public class Checkpoint : MonoBehaviour
 {
     private CheckpointManager cm;
 
+    public Sprite red;
+    public Sprite green;
+
     void Start()
     {
         cm = GameObject.FindGameObjectWithTag("CheckpointManager").GetComponent<CheckpointManager>();
@@ -16,6 +19,7 @@ public class Checkpoint : MonoBehaviour
         if(collision.CompareTag("Player"))
         {
             cm.lastCheckpointPos = transform.position;
+            GetComponent<SpriteRenderer>().sprite = green;
         }
     }
 }