示例#1
0
        public bool Intersects(Hitbox other, Vector2f myPos, Vector2f otherPos)
        {
            float dist = DistanceTo(other, myPos, otherPos);

            return(dist < Radius + other.Radius);
        }
示例#2
0
        public float AngleTo(Hitbox other, Vector2f myPos, Vector2f otherPos)
        {
            var delta = (otherPos + other.Position) - (myPos + Position);

            return((float)Math.Atan2(delta.Y, delta.X));
        }
示例#3
0
 public Bullet(int textureIndex, Hitbox hitbox, Vector2f position, float strength, bool isPiercing) : base("Content/bullets.png", textureIndex, hitbox, position)
 {
     Strength   = strength;
     IsPiercing = isPiercing;
 }