Explosion particles now
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user