Ratbots spawn randomly on circle around player

This commit is contained in:
2024-10-20 01:38:27 -07:00
parent 81b0797774
commit 1ce03803c4
3 changed files with 10 additions and 3 deletions

View File

@@ -25,9 +25,13 @@ public class GameState : MonoBehaviour
} }
public void NewWave() { public void NewWave() {
state = "WAVE"; state = "WAVE";
Vector3 position = GameObject.FindGameObjectWithTag("Player").transform.position; Vector3 playerPosition = GameObject.FindGameObjectWithTag("Player").GetComponent<Teo>().transform.position;
for (uint _ = 0; _ < wave; _++) { for (uint _ = 0; _ < wave; _++) {
GameObject newRatbot = Instantiate(ratbot); GameObject newRatbot = Instantiate(
ratbot,
Random.insideUnitCircle.normalized*20,
Quaternion.identity
);
newRatbot.GetComponent<Ratbot>().damageStrength = 5+wave*5; newRatbot.GetComponent<Ratbot>().damageStrength = 5+wave*5;
newRatbot.GetComponent<Ratbot>().health = 5+wave*2; newRatbot.GetComponent<Ratbot>().health = 5+wave*2;
} }

View File

@@ -105,6 +105,8 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
health: 100 health: 100
moveSpeed: 15 moveSpeed: 15
swingRange: 2
damageStrength: 10
--- !u!50 &-4152331571693237436 --- !u!50 &-4152331571693237436
Rigidbody2D: Rigidbody2D:
serializedVersion: 5 serializedVersion: 5

View File

@@ -102,9 +102,10 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 4d75aac518cf9dca0b16bb5a2e347204, type: 3} m_Script: {fileID: 11500000, guid: 4d75aac518cf9dca0b16bb5a2e347204, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
moveSpeed: 9.3 moveSpeed: 4
damageStrength: 10 damageStrength: 10
damageTimeoutSeconds: 0.5 damageTimeoutSeconds: 0.5
health: 10
--- !u!61 &8441426735084966298 --- !u!61 &8441426735084966298
BoxCollider2D: BoxCollider2D:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0