tanks collide with each other
This commit is contained in:
parent
461a9139c2
commit
89494ef495
5 changed files with 46 additions and 30 deletions
|
@ -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)
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue