public void EnemyAttack(string dir) { if (AttackRestRemaining <= 0) { if (inEnemyRange) { EnemyAttackFacing(dir); AnimControl.ShakeCamera(); AnimControl.PlayerBubbleAnimate("bubbleskull"); gameStatus.PlayerHP -= EnemyAttackValue; } AttackRestRemaining = AttackRestTime; } else { AttackRestRemaining -= Time.deltaTime; } }
public void RefreshItems() { if (gameStats.ItemKey1) { Key1.SetActive(false); animControl.PlayerBubbleAnimate("bubbledone"); } if (gameStats.ItemBriefcase) { Briefcase.SetActive(false); animControl.PlayerBubbleAnimate("bubbledone"); } if (gameStats.Health1) { Health1.SetActive(false); animControl.PlayerBubbleAnimate("bubbledone"); } if (gameStats.Health2) { Health2.SetActive(false); animControl.PlayerBubbleAnimate("bubbledone"); } if (gameStats.ItemBat) { Bat.SetActive(false); animControl.PlayerBubbleAnimate("bubbledone"); } if (gameStats.ItemFlashlight) { Flashlight.SetActive(false); animControl.PlayerBubbleAnimate("bubbledone"); } if (gameStats.ItemScrap) { Scrap.SetActive(false); animControl.PlayerBubbleAnimate("bubbledone"); } }
/* * if (gameObject.tag == "Enemy") * { * Debug.Log("THIS OBJECT IS TAGGED 'ENEMY'"); * } * */ private void OnTriggerStay2D(Collider2D col) { if (col.gameObject.tag == "Player") { if ((gameStatus.PlayerLocation == 3 || gameStatus.PlayerLocation == 4 || gameStatus.PlayerLocation == 6) && !gameStatus.FlashlightOn) { AnimControl.PlayerBubbleAnimate("bubbledot"); } else if (gameStatus.PlayerLocation == 0) { if ((gameObject.tag == "Door3" || gameObject.tag == "Door6") && gameStatus.FlashlightOn) { if (gameObject.tag == "Door6" && !gameStatus.ItemKey2) { // shit's locked AnimControl.PlayerBubbleAnimate("bubblelock"); } else { AnimControl.PlayerBubbleAnimate("bubbledoor"); if (Input.GetKeyDown("return")) { if (gameObject.tag == "Door6") { beam.TeleportRoom(6); } else { beam.TeleportRoom(3); } } } } else if ((gameObject.tag == "Door3" || gameObject.tag == "Door6") && !gameStatus.FlashlightOn) { // shit's dark } else if (gameObject.tag == "Door4" && !gameStatus.ItemKey1) { // shit's locked AnimControl.PlayerBubbleAnimate("bubblelock"); } else { AnimControl.PlayerBubbleAnimate("bubbledoor"); if (Input.GetKeyDown("return")) { if (gameObject.tag == "Door1") { beam.TeleportRoom(1); } else if (gameObject.tag == "Door2") { beam.TeleportRoom(2); } else if (gameObject.tag == "Door4") { beam.TeleportRoom(4); } else { beam.TeleportRoom(5); } } } } else { AnimControl.PlayerBubbleAnimate("bubbledoor"); if (Input.GetKeyDown("return")) { // rocket back to hallway beam.TeleportRoom(0); } } } }
/* * private void OnTriggerEnter2D(Collider2D col) * { * if (gameObject.tag == "Health" || gameObject.tag == "Health2") * { * animControl.PlayerBubbleAnimate("bubblehealth"); * } * else * { * animControl.PlayerBubbleAnimate("bubbleq"); * } * } */ private void OnTriggerExit2D(Collider2D col) { animControl.PlayerBubbleAnimate("bubbledone"); }