tank movement (without collision)

This commit is contained in:
Vinzenz Schroeter 2024-04-07 17:17:11 +02:00
parent a3bd582b2e
commit 54b840da3e
18 changed files with 321 additions and 254 deletions

View file

@ -0,0 +1,3 @@
namespace TanksServer.Models;
internal record struct FloatPosition(double X, double Y);

View file

@ -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;
}

View 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;
}