tanks collide with each other

This commit is contained in:
Vinzenz Schroeter 2024-04-12 19:49:24 +02:00
parent 461a9139c2
commit 89494ef495
5 changed files with 46 additions and 30 deletions

View file

@ -31,4 +31,13 @@ internal static class PositionHelpers
x: (ushort)(position.X / MapService.TileSize),
y: (ushort)(position.Y / MapService.TileSize)
);
public static FloatPosition ToFloatPosition(this PixelPosition position) => new(position.X, position.Y);
public static double Distance(this FloatPosition p1, FloatPosition p2)
=> Math.Sqrt(
Math.Pow(p1.X - p2.X, 2) +
Math.Pow(p1.Y - p2.Y, 2)
);
}