+
)
}
@@ -118,11 +126,20 @@ function Welcome() {
)
}
- // Draw the worlds
let worldUnlocked = completed[worldId][0]
let worldCompleted = completed[worldId].slice(1).every(Boolean)
+
+ // This selects the first uncompleted level
+ let nextLevel: number = completed[worldId].findIndex(c => !c)
+ if (nextLevel <= 1) {
+ // This uses the fact that `findIndex` returns `-1` if it does not find an uncompleted entry
+ // so `-1, 0, 1` are all the indices where we want to show the introduction.
+ nextLevel = 0
+ }
+
+ // Draw the worlds
svgElements.push(
-
+