Explosion particles now

This commit is contained in:
2024-11-03 22:13:01 -08:00
parent cbfd83e9e2
commit 7f7596e0c4
4 changed files with 4993 additions and 6 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -685,6 +685,7 @@ MonoBehaviour:
ratbot: {fileID: 398740452138961375, guid: 5887eeeb7c78eb5c7bf46c5893fd4846, type: 3}
gunThrower: {fileID: 398740452138961375, guid: b1e1e6378fb12d47e989565896a737ef, type: 3}
fastFucker: {fileID: 7192111562784377269, guid: 2c67a9ffe3cbdc6989fcabe398ffd2dc, type: 3}
creeper: {fileID: 398740452138961375, guid: ffe7e66eebc0e53d993926c0304591da, type: 3}
--- !u!4 &745837569
Transform:
m_ObjectHideFlags: 0

View File

@@ -73,6 +73,7 @@ public class GameState : MonoBehaviour
wave++;
}
public GameObject SpawnRatbot() {
return creeper;
// TODO: Convert this mess into a switch case
if (counts[(uint)CountIndex.gunThrower] < wave/3
&& wave > 2

View File

@@ -1,21 +1,26 @@
using UnityEngine;
using System.Collections;
public class Creeper : Ratbot
{
public GameObject particles;
float countdown;
void Update() {
if (Vector3.Distance(player.transform.position, transform.position) > 5) {
MoveTowardsPlayer(moveSpeed);
float newTime = countdown + Time.deltaTime;
countdown = (newTime < 1) ? newTime : 1;
countdown = Mathf.Min(newTime, 1);
} else {
countdown -= Time.deltaTime;
if (countdown < 0) Explode();
}
transform.GetChild(0).localScale = new Vector3 (countdown * 3.5F, 0.25F, 1);
}
void Explode() {
Destroy(gameObject);
Instantiate(particles);
if (Vector3.Distance(player.transform.position, transform.position) < 5) {
player.GetComponent<Teo>().health -= damageStrength;
}
}
}