Added health, respawning and Bullet spawners

This commit is contained in:
2022-04-18 00:32:24 +02:00
parent 1bd6d79672
commit 209470d610
227 changed files with 53417 additions and 40 deletions

View File

@@ -6,12 +6,14 @@ public class Enemy : MonoBehaviour
{
public int baseScore;
public PatternTypes[] patterns;
public int CurrentPattern;
public int CurrentPattern = 0;
private BulletManager bulletManager;
// Start is called before the first frame update
void Start()
{
bulletManager = GameObject.Find("BulletManager").GetComponent<BulletManager>();
Attack();
}
// Update is called once per frame
@@ -19,10 +21,10 @@ public class Enemy : MonoBehaviour
{
}
private void Attack()
{
//Spawn pattern
bulletManager.SpawnPattern(patterns[CurrentPattern], this);
}
public void Consumed()
@@ -31,9 +33,14 @@ public class Enemy : MonoBehaviour
}
private void OnPatternFinished()
public void OnPatternFinished()
{
//Increment pattern
CurrentPattern++;
if (CurrentPattern >= patterns.Length)
{
//Destroy(gameObject);
}
Attack();
}
}