save progress
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
// level config will be in one array
|
||||
// index 0 = level 1, etc
|
||||
// edit level change calculations here
|
||||
// x,y = center position. w, h = width and height of the platform
|
||||
|
||||
export const LEVELS = [
|
||||
{
|
||||
id: 1,
|
||||
name: 'The Gray Beginning',
|
||||
color: '#FF4136',
|
||||
//bgFar: '/backgrounds/level1_far/png',
|
||||
//bgMid: '/backgrounds/level1_mid.png',
|
||||
spawnX: 80,
|
||||
spawnY: 380,
|
||||
|
||||
// each platform: {x,y,w,h}
|
||||
platforms: [
|
||||
{x: 400, y: 440, w: 800, h: 20}, // ground
|
||||
{x: 220, y: 360, w: 160, h: 16},
|
||||
{x: 430, y: 300, w: 140, h: 16 },
|
||||
{x: 640, y: 240, w: 160, h: 16 },
|
||||
{x: 320, y: 210, w: 120, h: 16 },
|
||||
],
|
||||
|
||||
// each fragment: {x,y,color}
|
||||
fragments: [
|
||||
{x: 220, y: 330, color: '#FF4136'},
|
||||
{x: 430, y: 270, color: '#FF4136'},
|
||||
{x: 640, y: 210, color: '#FF4136'},
|
||||
],
|
||||
|
||||
// each enemy: {x,y, patrol}
|
||||
enemies: [
|
||||
{x: 430, y: 280, patrol: 50},
|
||||
],
|
||||
|
||||
// each puddle: {x, y}
|
||||
tar: [],
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: 'Warmer skies',
|
||||
color: '#FF851B',
|
||||
bgFar: '/backgrounds/level2_far.png',
|
||||
bgMid: '/backgrounds/level2_mid.png',
|
||||
spawnX: 80,
|
||||
spawnY: 380,
|
||||
|
||||
platforms: [
|
||||
{ x: 400, y: 440, w: 800, h: 20 },
|
||||
{ x: 180, y: 370, w: 140, h: 16 },
|
||||
{ x: 380, y: 310, w: 120, h: 16 },
|
||||
{ x: 560, y: 250, w: 120, h: 16 },
|
||||
{ x: 700, y: 330, w: 100, h: 16 },
|
||||
{ x: 300, y: 200, w: 100, h: 16 },
|
||||
],
|
||||
|
||||
fragments: [
|
||||
{ x: 180, y: 340, color: '#FF851B' },
|
||||
{ x: 380, y: 280, color: '#FF851B' },
|
||||
{ x: 300, y: 170, color: '#FF851B' },
|
||||
{ x: 700, y: 300, color: '#FF851B' },
|
||||
],
|
||||
|
||||
enemies: [
|
||||
{ x: 380, y: 290, patrol: 45 },
|
||||
{ x: 560, y: 230, patrol: 40 },
|
||||
],
|
||||
|
||||
tar: [
|
||||
{ x: 150, y: 432 },
|
||||
],
|
||||
},
|
||||
// Levels 3–5 will follow the same pattern
|
||||
];
|
||||
|
||||
|
||||
// get level by ID (indexed)
|
||||
export function getLevel(id){
|
||||
return LEVELS.find(level => level.id === id)
|
||||
}
|
||||
Reference in New Issue
Block a user