Ratbots spawn randomly on circle around player
This commit is contained in:
@@ -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<Teo>().transform.position;
|
||||
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>().health = 5+wave*2;
|
||||
}
|
||||
|
||||
@@ -105,6 +105,8 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
health: 100
|
||||
moveSpeed: 15
|
||||
swingRange: 2
|
||||
damageStrength: 10
|
||||
--- !u!50 &-4152331571693237436
|
||||
Rigidbody2D:
|
||||
serializedVersion: 5
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user