Refactor/entities splitting #4

Merged
ilia merged 18 commits from refactor/entities-splitting into main 2026-07-18 08:02:47 +00:00
Showing only changes of commit d149721a84 - Show all commits
+27
View File
@@ -0,0 +1,27 @@
/**
* Класс сущности "мяч"
* @class
*/
export class Ball {
/**
* @param {number} x координата положения мяча по оси X
* @param {number} y координата положения мяча по оси Y
* @param {number} radius положительное числовое значение радиуса мяча
*/
constructor(x, y, radius) {
this.x = x;
this.y = y;
this.horizontalSpeed = 0;
this.verticalSpeed = 0;
this.radius = radius;
}
/**
* Изменяет координаты в зависимости от скорости и времени
* @param {*} deltaTime изменение времени из Ticker
*/
moveForvard(deltaTime) {
this.x += this.horizontalSpeed * deltaTime;
this.y += this.verticalSpeed * deltaTime;
}
}