function defineMaps() {
maps = [
{
name: "Map 1: Grassy Plains",
targetScore: 5, // Score needed to unlock Map 2
obstacles: [
{ x: 0.2, y: 0.3, w: 100, h: 50 },
{ x: 0.7, y: 0.6, w: 80, h: 80 },
{ x: 0.5, y: 0.1, w: 150, h: 30 },
],
key: { x: 0.2, y: 0.2 },
},
{
name: "Map 2: Rocky Foothills",
targetScore: 10,
obstacles: [
{ x: 0.1, y: 0.2, w: 120, h: 60 },
{ x: 0.4, y: 0.5, w: 70, h: 100 },
{ x: 0.8, y: 0.3, w: 90, h: 40 },
{ x: 0.6, y: 0.8, w: 110, h: 80 },
]
},
{
name: "Map 3: Sandy Desert",
targetScore: 15,
obstacles: [
{ x: 0.3, y: 0.1, w: 180, h: 40 },
{ x: 0.6, y: 0.4, w: 50, h: 150 },
{ x: 0.2, y: 0.7, w: 100, h: 100 },
{ x: 0.8, y: 0.9, w: 130, h: 60 },
]
},
{
name: "Map 4: Misty Forest",
targetScore: 20,
obstacles: [
{ x: 0.1, y: 0.1, w: 100, h: 100 },
{ x: 0.9, y: 0.1, w: 100, h: 100 },
{ x: 0.1, y: 0.9, w: 100, h: 100 },
{ x: 0.9, y: 0.9, w: 100, h: 100 },
{ x: 0.5, y: 0.5, w: 150, h: 150 },
]
},
{
name: "Map 5: Icy Tundra",
targetScore: Infinity,
obstacles: [
{ x: 0.15, y: 0.15, w: 80, h: 80 },
{ x: 0.85, y: 0.15, w: 80, h: 80 },
{ x: 0.15, y: 0.85, w: 80, h: 80 },
{ x: 0.85, y: 0.85, w: 80, h: 80 },
{ x: 0.4, y: 0.4, w: 60, h: 60 },
{ x: 0.6, y: 0.6, w: 60, h: 60 },
{ x: 0.4, y: 0.6, w: 60, h: 60 },
{ x: 0.6, y: 0.4, w: 60, h: 60 },
]
},
{
name: "Map 6: Asteroid Field",
targetScore: 25,
obstacles: [
{ x: 0.2, y: 0.2, w: 70, h: 70 },
{ x: 0.8, y: 0.2, w: 70, h: 70 },
{ x: 0.2, y: 0.8, w: 70, h: 70 },
{ x: 0.8, y: 0.8, w: 70, h: 70 },
{ x: 0.5, y: 0.5, w: 100, h: 100 },
{ x: 0.3, y: 0.4, w: 40, h: 120 },
{ x: 0.7, y: 0.6, w: 120, h: 40 },
]
}
];
// Ensure unlockedMapsCount doesn't exceed the number of defined maps
unlockedMapsCount = constrain(unlockedMapsCount, 1, maps.length);
}