feat(perk): Добавлен бонус увеличивающий размер ракетки
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user