Open Zynchronous opened 2 years ago
Hi!
I've looked at the code and I am not 100% sure if something like this is supported.
When you travel along the map, the nodes that you can travel to next are defined by your previous path: mapManager.CurrentMap.path
You can travel to "outgoing"nodes from the last point of the path.
If you want to allow traveling to the node where you lost a battle with the enemy, I think, the easiest thing to do is - return the player to the previous node. You can do that by removing the last element from mapManager.CurrentMap.path
. This way it will revert the player to where he was originally before he reached the node where he lost.
Would this work?
Hello,
Generally if you loose it's a GameOver, but If the player quit and relaunch the game, he will pass the level without fighting. So It important to rollback if we detect this situation
I use this function to do that :
var currentPoint = mapManager.CurrentMap.path[mapManager.CurrentMap.path.Count - 1];
var currentNode = mapManager.CurrentMap.GetNode(currentPoint);
mapManager.CurrentMap.path.Remove(currentNode.point);
mapManager.SaveMap();
view.SetAttainableNodes();
view.SetLineColors();
Thanks for your great project !
I'm learning c# coding and I'm not good at English. Thanks for reading.