feat(perk): Добавлен бонус увеличивающий размер ракетки

This commit is contained in:
Ilia Mashkov
2026-07-19 15:32:09 +03:00
parent 511b20c939
commit b7e16f86ea
5 changed files with 33 additions and 9 deletions
+2 -7
View File
@@ -1,11 +1,6 @@
import { PERK_FALL_SPEED, PERK_HEIGHT, PERK_WIDTH } from '../../config';
import { PERK_FALL_SPEED, PERK_HEIGHT, PERK_TYPES, PERK_WIDTH } from '../../config';
import { Perk } from '../../entities/perk/perk';
/**
* Типы бонусов
*/
const DROPPABLE_PERKS = ['slow'];
/**
* Создает случайный бонус в заданной точке
* @param {number} x координата бонуса по оси X
@@ -18,7 +13,7 @@ export function spawnRandomPerk(x, y) {
throw new Error('Координаты бонуса должны являться числами');
}
const type = DROPPABLE_PERKS[Math.floor(Math.random() * DROPPABLE_PERKS.length)];
const type = PERK_TYPES[Math.floor(Math.random() * PERK_TYPES.length)];
return new Perk(x, y, PERK_WIDTH, PERK_HEIGHT, type, PERK_FALL_SPEED);
} catch (err) {