]> git.lizzy.rs Git - SuperMouseAdventure.git/blob - 2DGame/Assets/Scripts/Enemies/EnemyScript.cs
Idle Animation Schnecke
[SuperMouseAdventure.git] / 2DGame / Assets / Scripts / Enemies / EnemyScript.cs
1 using System.Collections;
2 using System.Collections.Generic;
3 using UnityEngine;
4
5 public class EnemyScript : MonoBehaviour
6 {
7     public int enemyHealth;
8     public int enemyDamage;
9
10     public bool spiky;
11
12     // Update is called once per frame
13     void Update()
14     {
15         if (enemyHealth <= 0)
16         {
17             GetComponent<Collider2D>().enabled = false;
18             GetComponent<FollowPlayer>().enabled = false;
19             GetComponent<Rigidbody2D>().gravityScale = 10;
20             Destroy(gameObject, 2);
21         }
22     }
23 }