*/ public array $trail = []; public int $hits = 0; public bool $escaped = false; /** @var array anything the game wants to keep with it (a name, a score...) */ public array $data = []; public function __construct( public float $x, public float $y, public float $vx = 0, public float $vy = 0, public float $radius = 8, public string $color = '#ffffff', public int $trailLength = 24, ) { } public function speed(): float { return sqrt($this->vx * $this->vx + $this->vy * $this->vy); } }