diff --git a/Zookeepers Trial/.vs/Zookeepers Trial/v14/.suo b/Zookeepers Trial/.vs/Zookeepers Trial/v14/.suo index 7fc85b1101e3dabb65ca6f9ce55a7fb57c4faf63..ff61b059fba5a0112d7e11ca81e9f0c929420630 100644 Binary files a/Zookeepers Trial/.vs/Zookeepers Trial/v14/.suo and b/Zookeepers Trial/.vs/Zookeepers Trial/v14/.suo differ diff --git a/Zookeepers Trial/Assets/Scenes/arena.unity b/Zookeepers Trial/Assets/Scenes/arena.unity index bc4c8e14389c3231b0b1ad1ef23374f1df1782a7..ffeca3ea0b22451fa06bb738fa9d3d1a07fc769e 100644 Binary files a/Zookeepers Trial/Assets/Scenes/arena.unity and b/Zookeepers Trial/Assets/Scenes/arena.unity differ diff --git a/Zookeepers Trial/Assets/Scripts/ArenaCombatControl.cs b/Zookeepers Trial/Assets/Scripts/ArenaCombatControl.cs index 3bd13b940e7039ef78f122ed84e5e319a6a51096..37acfbde93c974029690faa3c4afa68f3b58eaca 100644 --- a/Zookeepers Trial/Assets/Scripts/ArenaCombatControl.cs +++ b/Zookeepers Trial/Assets/Scripts/ArenaCombatControl.cs @@ -12,8 +12,11 @@ public class ArenaCombatControl : MonoBehaviour { private float speed; private bool LookRight = true; private bool canMove = true; - private bool canJump = false; + private bool canJump = false; + private bool canBlock = true; + private bool canRefill = false; private float attackSpeedCooldown; + private float blockCoolDown; // fields to modify player stats based on weapons -- now in CharacterLook script!! ***** /* public WeaponStats[] weapons; @@ -27,6 +30,7 @@ public class ArenaCombatControl : MonoBehaviour { Player = GetComponent<Rigidbody2D>(); myAnimator = GetComponent<Animator>(); //required for animation ******* //SetWeaponStats(); + blockCoolDown = 3; } // Update is called once per frame @@ -42,8 +46,8 @@ public class ArenaCombatControl : MonoBehaviour { Jump(); } - - //controlling the characters movement + + //controlling the characters movement private void Movement(float horizontal) { if (canMove) { @@ -66,23 +70,50 @@ public class ArenaCombatControl : MonoBehaviour { } private void Block() { - if (Input.GetKeyDown(KeyCode.E)) { + // blockCoolDown -= Time.deltaTime; + Debug.Log(blockCoolDown); + if (canBlock == true && Input.GetKey(KeyCode.E)) { + Debug.Log("blocking"); myAnimator.SetBool("block", true); Player.velocity = Vector2.zero; canMove = false; + canRefill = false; + blockCoolDown -= Time.deltaTime; + } + + if (blockCoolDown < 0) { + canRefill = false; + canBlock = false; + } + + if (canBlock == false) { + Debug.Log("filling"); + myAnimator.SetBool("block", false); + blockCoolDown += Time.deltaTime; + } + if (blockCoolDown > 3) { + Debug.Log("true"); + canBlock = true; } + if (Input.GetKeyUp(KeyCode.E)) { + Debug.Log("KeyOff"); myAnimator.SetBool("block", false); canMove = true; - + canRefill = true; } + if (canRefill == true) { + if (blockCoolDown < 3) { + blockCoolDown += Time.deltaTime; + } + } } private void Jump() { - if (Input.GetKeyDown(KeyCode.W)&&canJump) { - canJump = false; + if (Input.GetKeyDown(KeyCode.W) && canJump) { + canJump = false; Player.AddForce(new Vector2(0, 300)); } } @@ -126,13 +157,13 @@ public class ArenaCombatControl : MonoBehaviour { } } - void OnCollisionEnter2D(Collision2D coll){ - if (coll.gameObject.tag == "ground") { - canJump = true; - } - } + void OnCollisionEnter2D(Collision2D coll) { + if (coll.gameObject.tag == "ground") { + canJump = true; + } + } + - /* can change stats simply in the inspector for dynamic purposes :) //a few proposed weapon stats private void SetWeaponStats() diff --git a/Zookeepers Trial/Library/CurrentLayout.dwlt b/Zookeepers Trial/Library/CurrentLayout.dwlt index f545f6119a98babb4215b045257bbb0b759dede8..b9aeb09779f9041c139deea390a900cfdf22a776 100644 Binary files a/Zookeepers Trial/Library/CurrentLayout.dwlt and b/Zookeepers Trial/Library/CurrentLayout.dwlt differ diff --git a/Zookeepers Trial/Library/ScriptAssemblies/Assembly-CSharp.dll b/Zookeepers Trial/Library/ScriptAssemblies/Assembly-CSharp.dll index bc6d0607438e204563287beca5f027750831598b..153617bbf3a4447f2517f5f956afd0fc466bf71c 100644 Binary files a/Zookeepers Trial/Library/ScriptAssemblies/Assembly-CSharp.dll and b/Zookeepers Trial/Library/ScriptAssemblies/Assembly-CSharp.dll differ diff --git a/Zookeepers Trial/Library/ScriptAssemblies/Assembly-CSharp.dll.mdb b/Zookeepers Trial/Library/ScriptAssemblies/Assembly-CSharp.dll.mdb index 89640c2b5a02c3ec607537820b21ee50a923ab62..76952e73931b1b2b8b865568b2452a05948d4f97 100644 Binary files a/Zookeepers Trial/Library/ScriptAssemblies/Assembly-CSharp.dll.mdb and b/Zookeepers Trial/Library/ScriptAssemblies/Assembly-CSharp.dll.mdb differ diff --git a/Zookeepers Trial/Library/assetDatabase3 b/Zookeepers Trial/Library/assetDatabase3 index e7f9d606e7ea4a6fb8d4ceb386eda43243b68b65..2f382c23ace0bbcb3d8d46a8de34a84511035c8f 100644 Binary files a/Zookeepers Trial/Library/assetDatabase3 and b/Zookeepers Trial/Library/assetDatabase3 differ diff --git a/Zookeepers Trial/Library/expandedItems b/Zookeepers Trial/Library/expandedItems index ec552c943638eb457d7d75f75738a20ef180dfa6..e5536878d777720bfe4bcc4a735983d02a523c2c 100644 Binary files a/Zookeepers Trial/Library/expandedItems and b/Zookeepers Trial/Library/expandedItems differ diff --git a/Zookeepers Trial/Library/metadata/00/00000000000000004000000000000000 b/Zookeepers Trial/Library/metadata/00/00000000000000004000000000000000 index a6d58062abfd7605ae7a9193242e266b1a16fe77..667bd71dad5571edb07fb18b64cf8723a440c26e 100644 Binary files a/Zookeepers Trial/Library/metadata/00/00000000000000004000000000000000 and b/Zookeepers Trial/Library/metadata/00/00000000000000004000000000000000 differ diff --git a/Zookeepers Trial/Library/metadata/00/00000000000000006100000000000000 b/Zookeepers Trial/Library/metadata/00/00000000000000006100000000000000 index 5defd9c095afd775b32bb6d5055dfbce942afad3..3e40f2606b0fa29a89df434c6df0226a9984c9a9 100644 Binary files a/Zookeepers Trial/Library/metadata/00/00000000000000006100000000000000 and b/Zookeepers Trial/Library/metadata/00/00000000000000006100000000000000 differ diff --git a/Zookeepers Trial/Library/metadata/53/537bd552e039b684db164ee454e43761 b/Zookeepers Trial/Library/metadata/53/537bd552e039b684db164ee454e43761 index bebd30e0c6b648710115b2e6d8c946d73adb96bc..b08c4bd0356d4b49efd8216b93a008d61bace688 100644 Binary files a/Zookeepers Trial/Library/metadata/53/537bd552e039b684db164ee454e43761 and b/Zookeepers Trial/Library/metadata/53/537bd552e039b684db164ee454e43761 differ