From 1ce03803c4580c07b069c4526526636b6e998361 Mon Sep 17 00:00:00 2001 From: ProtoSharkk Date: Sun, 20 Oct 2024 01:38:27 -0700 Subject: [PATCH] Ratbots spawn randomly on circle around player --- Assets/GameState.cs | 8 ++++++-- Assets/Player.prefab | 2 ++ Assets/Ratbot.prefab | 3 ++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Assets/GameState.cs b/Assets/GameState.cs index 0189a73..ad43805 100644 --- a/Assets/GameState.cs +++ b/Assets/GameState.cs @@ -25,9 +25,13 @@ public class GameState : MonoBehaviour } public void NewWave() { state = "WAVE"; - Vector3 position = GameObject.FindGameObjectWithTag("Player").transform.position; + Vector3 playerPosition = GameObject.FindGameObjectWithTag("Player").GetComponent().transform.position; for (uint _ = 0; _ < wave; _++) { - GameObject newRatbot = Instantiate(ratbot); + GameObject newRatbot = Instantiate( + ratbot, + Random.insideUnitCircle.normalized*20, + Quaternion.identity + ); newRatbot.GetComponent().damageStrength = 5+wave*5; newRatbot.GetComponent().health = 5+wave*2; } diff --git a/Assets/Player.prefab b/Assets/Player.prefab index 37df825..aec03f0 100644 --- a/Assets/Player.prefab +++ b/Assets/Player.prefab @@ -105,6 +105,8 @@ MonoBehaviour: m_EditorClassIdentifier: health: 100 moveSpeed: 15 + swingRange: 2 + damageStrength: 10 --- !u!50 &-4152331571693237436 Rigidbody2D: serializedVersion: 5 diff --git a/Assets/Ratbot.prefab b/Assets/Ratbot.prefab index cd78b22..4ddd195 100644 --- a/Assets/Ratbot.prefab +++ b/Assets/Ratbot.prefab @@ -102,9 +102,10 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 4d75aac518cf9dca0b16bb5a2e347204, type: 3} m_Name: m_EditorClassIdentifier: - moveSpeed: 9.3 + moveSpeed: 4 damageStrength: 10 damageTimeoutSeconds: 0.5 + health: 10 --- !u!61 &8441426735084966298 BoxCollider2D: m_ObjectHideFlags: 0