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}
|
ratbot: {fileID: 398740452138961375, guid: 5887eeeb7c78eb5c7bf46c5893fd4846, type: 3}
|
||||||
gunThrower: {fileID: 398740452138961375, guid: b1e1e6378fb12d47e989565896a737ef, type: 3}
|
gunThrower: {fileID: 398740452138961375, guid: b1e1e6378fb12d47e989565896a737ef, type: 3}
|
||||||
fastFucker: {fileID: 7192111562784377269, guid: 2c67a9ffe3cbdc6989fcabe398ffd2dc, type: 3}
|
fastFucker: {fileID: 7192111562784377269, guid: 2c67a9ffe3cbdc6989fcabe398ffd2dc, type: 3}
|
||||||
|
creeper: {fileID: 398740452138961375, guid: ffe7e66eebc0e53d993926c0304591da, type: 3}
|
||||||
--- !u!4 &745837569
|
--- !u!4 &745837569
|
||||||
Transform:
|
Transform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ public class GameState : MonoBehaviour
|
|||||||
wave++;
|
wave++;
|
||||||
}
|
}
|
||||||
public GameObject SpawnRatbot() {
|
public GameObject SpawnRatbot() {
|
||||||
|
return creeper;
|
||||||
// TODO: Convert this mess into a switch case
|
// TODO: Convert this mess into a switch case
|
||||||
if (counts[(uint)CountIndex.gunThrower] < wave/3
|
if (counts[(uint)CountIndex.gunThrower] < wave/3
|
||||||
&& wave > 2
|
&& wave > 2
|
||||||
|
|||||||
@@ -1,21 +1,26 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using System.Collections;
|
|
||||||
|
|
||||||
public class Creeper : Ratbot
|
public class Creeper : Ratbot
|
||||||
{
|
{
|
||||||
|
public GameObject particles;
|
||||||
float countdown;
|
float countdown;
|
||||||
|
|
||||||
void Update() {
|
void Update() {
|
||||||
if (Vector3.Distance(player.transform.position, transform.position) > 5) {
|
if (Vector3.Distance(player.transform.position, transform.position) > 5) {
|
||||||
MoveTowardsPlayer(moveSpeed);
|
MoveTowardsPlayer(moveSpeed);
|
||||||
float newTime = countdown + Time.deltaTime;
|
float newTime = countdown + Time.deltaTime;
|
||||||
countdown = (newTime < 1) ? newTime : 1;
|
countdown = Mathf.Min(newTime, 1);
|
||||||
} else {
|
} else {
|
||||||
countdown -= Time.deltaTime;
|
countdown -= Time.deltaTime;
|
||||||
if (countdown < 0) Explode();
|
if (countdown < 0) Explode();
|
||||||
}
|
}
|
||||||
|
transform.GetChild(0).localScale = new Vector3 (countdown * 3.5F, 0.25F, 1);
|
||||||
}
|
}
|
||||||
void Explode() {
|
void Explode() {
|
||||||
Destroy(gameObject);
|
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