tank movement (without collision)
This commit is contained in:
parent
a3bd582b2e
commit
54b840da3e
18 changed files with 321 additions and 254 deletions
3
TanksServer/Models/FloatPosition.cs
Normal file
3
TanksServer/Models/FloatPosition.cs
Normal file
|
@ -0,0 +1,3 @@
|
|||
namespace TanksServer.Models;
|
||||
|
||||
internal record struct FloatPosition(double X, double Y);
|
|
@ -1,8 +1,16 @@
|
|||
namespace TanksServer.Models;
|
||||
|
||||
internal sealed class Tank(Player player, PixelPosition spawnPosition)
|
||||
internal sealed class Tank(Player player, FloatPosition spawnPosition)
|
||||
{
|
||||
private double _rotation;
|
||||
|
||||
public Player Owner { get; } = player;
|
||||
public int Rotation { get; set; }
|
||||
public PixelPosition Position { get; set; } = spawnPosition;
|
||||
|
||||
public double Rotation
|
||||
{
|
||||
get => _rotation;
|
||||
set => _rotation = value % 16d;
|
||||
}
|
||||
|
||||
public FloatPosition Position { get; set; } = spawnPosition;
|
||||
}
|
||||
|
|
9
TanksServer/Models/TanksConfiguration.cs
Normal file
9
TanksServer/Models/TanksConfiguration.cs
Normal file
|
@ -0,0 +1,9 @@
|
|||
namespace TanksServer.Models;
|
||||
|
||||
public class TanksConfiguration
|
||||
{
|
||||
public double MoveSpeed { get; set; } = 1.4;
|
||||
public double TurnSpeed { get; set; } = 0.4;
|
||||
public double ShootDelayMs { get; set; } = 0.4 * 1000;
|
||||
public double BulletSpeed { get; set; } = 8;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue