27 lines
803 B
JavaScript
27 lines
803 B
JavaScript
import tutorial from './tutorial.js';
|
|
import jump from './jump.js';
|
|
import endurance from './endurance.js';
|
|
import boss from './boss.js';
|
|
import troll from './troll.js';
|
|
|
|
const raw = [...tutorial, ...jump, ...endurance, ...boss, ...troll];
|
|
raw.forEach((l, i) => { l.index = i; l.builtin = true; });
|
|
|
|
export const LEVELS = raw;
|
|
|
|
export const TYPE_LABEL = {
|
|
jump: '跳刺', endur: '耐久', boss: 'BOSS', troll: '坑向', custom: '自制',
|
|
};
|
|
export const TYPE_CLASS = {
|
|
jump: 't-jump', endur: 't-endur', boss: 't-boss', troll: 't-troll', custom: 't-custom',
|
|
};
|
|
|
|
let uid = 0;
|
|
export function makeCustomLevel(data) {
|
|
return { ...data, id: 'u' + (Date.now() % 100000) + (uid++), type: 'custom', builtin: false, index: -1 };
|
|
}
|
|
|
|
export function findLevel(id) {
|
|
return LEVELS.find(l => l.id === id);
|
|
}
|