Skip to content
This repository was archived by the owner on Aug 9, 2024. It is now read-only.

Commit 2902f5f

Browse files
committed
Gave enemies controller difficult options
1 parent da883a8 commit 2902f5f

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

Assets/Scripts/MeleeEnemy.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,14 @@ void MakeSureStuffIsInitialized() {
6969
if (smoothVelocity == null) {
7070
smoothVelocity = Vector3.zero;
7171
}
72+
73+
if (player.GetComponent<Player>().isSpaceLike) {
74+
maxLOSDistance = 30f;
75+
moveSpeed = 30f;
76+
} else {
77+
maxLOSDistance = 20f;
78+
moveSpeed = 20;
79+
}
7280
}
7381

7482
void OnCollisionEnter2D(Collision2D collision) {

Assets/Scripts/RangedEnemy.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ public class RangedEnemy : MonoBehaviour {
1717
Vector3 lastSeenPlayer;
1818
Vector3 smoothVelocity;
1919

20+
private void Start() {
21+
22+
}
23+
2024
// Update is called once per frame
2125
void Update () {
2226
MakeSureStuffIsInitialized();
@@ -74,6 +78,16 @@ void MakeSureStuffIsInitialized() {
7478
if (laserPool == null) {
7579
laserPool = GameObject.FindWithTag("Laserpool").GetComponent<GameObjectPool>();
7680
}
81+
82+
if (player.GetComponent<Player>().isSpaceLike) {
83+
maxLOSDistance = 25f;
84+
moveSpeed = 10;
85+
shotDelay = 2;
86+
} else {
87+
maxLOSDistance = 15;
88+
moveSpeed = 0;
89+
shotDelay = 3;
90+
}
7791
}
7892

7993
void TrackShooting() {

0 commit comments

Comments
 (0)