diff --git a/Assets/Scripts C#/Teo.cs b/Assets/Scripts C#/Teo.cs index 32d3042..d88ea9a 100644 --- a/Assets/Scripts C#/Teo.cs +++ b/Assets/Scripts C#/Teo.cs @@ -94,9 +94,21 @@ public class Teo : MonoBehaviour ).normalized * dashDistance); // Wait 0.2 seconds before ending the dash yield return new WaitForSeconds(0.2F); - // Re enable collision and linearDamping after dash complete + // Re enable collision and linearDamping after dash dashing = false; - collider.enabled = true; controller.linearDamping = 15; + // Push enemies away at end of dash + foreach (Collider2D hit in Physics2D.OverlapCircleAll( + transform.position, 3 + )) { + if (hit.tag != "Ratbot") continue; + hit.GetComponent().AddRelativeForce( + (hit.transform.position - transform.position) + .normalized * dashDistance + ); + } + // Don't take damage at end of dash + yield return new WaitForSeconds(0.2F); + collider.enabled = true; } }