Пример #1
0
 public void Drop()
 {
     position = holder.Position + new Vector2(0, 2f);
     velocity = TKMath.GetAngleVector(90 + ((float)Map.rng.NextDouble() - 0.5f) * 70f) * 20f;
     holder   = null;
 }
Пример #2
0
 public DashTarget(Vector2 a, Vector2 b)
 {
     startPosition = a;
     endPosition   = b;
     angle         = TKMath.GetAngle(a, b);
 }
Пример #3
0
        public void Rotate(Vector2 origin, float delta)
        {
            float currentAngle = TKMath.GetAngle(position - origin) + delta;

            RotateTo(origin, currentAngle);
        }
Пример #4
0
        public void RotateTo(Vector2 origin, float angle)
        {
            float distance = (position - origin).Length;

            position = origin + TKMath.GetAngleVector(angle) * distance;
        }
Пример #5
0
 public virtual void Hit(Actor a)
 {
     Hit(a.Position);
     a.Hit(damage, TKMath.GetAngle(velocity), this);
 }