Week 9—Enemies / Interaction / Puzzles
Enter the Cell » Devlog
Week 9—Enemies / Interaction / Puzzles
enemies
types
There are 4
different enemies (bacteria)
public enum InvaderType { COVID, INVADER1, INVADER2, INVADER3, }
Prefabs

how to instance
- there is an
InvaderManager
Component which controls how to instance a invader
random get a invader prefab by using Random.Range
int index = UnityEngine.Random.Range(0, 4); if (type == (int)InvaderType.COVID) { prefab = GameManager.instance.Conf.InvaderCOVIDPrefab; } else if (type == (int)InvaderType.INVADER1) { prefab = GameManager.instance.Conf.Invader1Prefab; } else if (type == (int)InvaderType.INVADER2) { prefab = GameManager.instance.Conf.Invader2Prefab; } else if (type == (int)InvaderType.INVADER3) { prefab = GameManager.instance.Conf.Invader3Prefab; }
Interaction
white blood cell destroy invaders
produce a bullet every 2 seconds in white blood cell
InvokeRepeating("Attack",3,2);
decrease invader when bullet trigger OnTriggerEnter2D
if(other.gameObject.CompareTag("Invader")) { other.gameObject.GetComponent<InvaderHealth>().DecreaseHealth(DecreaseNumber); }
destroy an invader
if this is not a covid and health become 0, it destroys itself and creates a covid instance.
Health -= number; if (Health <= 0) { if (Type != InvaderType.COVID) { GameObject invaderInstance = InvaderManager.instance.Instance((int)InvaderType.COVID); } Destroy(gameObject); }

Files
Screen Recording 2020-09-07 at 00.07.28.mov 23 MB
Sep 06, 2020
EnterTheCell.zip Play in browser
Sep 06, 2020
Get Enter the Cell
Enter the Cell
More posts
- documentOct 29, 2020
- Week 12—Updates/planned updates based upon Testing SessionOct 11, 2020
- Game TestOct 05, 2020
- Week 10—Presentation / GraphicsSep 27, 2020
- Enter the CellAug 28, 2020
Leave a comment
Log in with itch.io to leave a comment.