Add Prim/Kruskal maze gen & nodeData refactor
Implement Prim and Kruskal maze generation in the Labyrinth component with animated generation and UI guards. Introduces isAnimationRunning signal, mazeAnimationSpeed, maze node order tracking and animateMazeGeneration; createRandom(now takes a boolean) triggers either Prim or Kruskal flow, sets random start/end, and animates. Refactor Node.distance -> nodeData across models, components and the PathfindingService (Dijkstra/A*) to use nodeData for g-scores/ids. Add SharedFunctions.shuffleArray utility and update i18n (EN/DE) with labels for Prim/Kruskal. Misc: minor cleanup/init changes and drawing logic adjustments to support the new maze flows.
This commit is contained in:
@@ -363,6 +363,8 @@
|
||||
},
|
||||
"LABYRINTH": {
|
||||
"TITLE": "Labyrinth Generation",
|
||||
"PRIM": "Generate Prim's Labyrinth",
|
||||
"KRUSKAL": "Generate Kruskal's Labyrinth",
|
||||
"EXPLANATION": {
|
||||
"TITLE": "Algorithms",
|
||||
"PRIM_EXPLANATION": "starts at a random point and expands the labyrinth by always selecting a random neighboring wall of an already visited cell and opening it. Advantage: Produces very uniform, natural-looking labyrinths with many short dead ends. Visually, it appears like organic growth from a central point.",
|
||||
|
||||
Reference in New Issue
Block a user