Skip to content

Commit

Permalink
Goal node hidden until first player reaches it
Browse files Browse the repository at this point in the history
  • Loading branch information
BeeSneeze committed Jan 27, 2024
1 parent c599866 commit ef65be7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions wikiweaver-web/js/graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,11 @@ function AddNewElement(PColor, ToString, timeadded, backmove) {
// Reposition the player to the new node
CList.fromnode = ToString;

// If goal node has been found, show it
if (webgraph.nodes('[group = "Goal"]').degree() > 0) {
webgraph.nodes('[group = "Goal"]').show();
}

ForceNewLayout(NewNodeOptions);
}

Expand Down Expand Up @@ -329,6 +334,8 @@ function StartGame(StartNode, GoalNode) {
webgraph.nodes('[group = "Goal"]').style("width", 40);
webgraph.nodes('[group = "Goal"]').style("height", 40);

webgraph.nodes('[group = "Goal"]').hide()

ForceNewLayout();

// document.getElementById("redraw-button").disabled = false;
Expand Down

0 comments on commit ef65be7

Please sign in to comment.