Testing Multi object solve. I need to fix Tree array Bug with DE
This commit is contained in:
@@ -11,7 +11,7 @@ var Intersections = [[]]
|
|||||||
|
|
||||||
var Intersections_Copy = []
|
var Intersections_Copy = []
|
||||||
var Distance_From_Intersection = 0
|
var Distance_From_Intersection = 0
|
||||||
var Tree_Array = []
|
var Tree_Array = [99]
|
||||||
var Options = []
|
var Options = []
|
||||||
var BackTrack_Array = []
|
var BackTrack_Array = []
|
||||||
var Traveled = false
|
var Traveled = false
|
||||||
@@ -59,7 +59,7 @@ var CircleInts = 0
|
|||||||
var LogDumpOrdered = []
|
var LogDumpOrdered = []
|
||||||
var Order = []
|
var Order = []
|
||||||
var Intersections_from_root = []
|
var Intersections_from_root = []
|
||||||
var TargetCord = [[0,-11], [13,-13]] # HAD TO CHANGE TARGET CORD, IT WAS PREVIOUSLY [2,-10]
|
var TargetCord = [[0,-11], [13,-13], [1,-20]] # HAD TO CHANGE TARGET CORD, IT WAS PREVIOUSLY [2,-10]
|
||||||
var CircleCompleted = null
|
var CircleCompleted = null
|
||||||
var AutoBacktrack = false
|
var AutoBacktrack = false
|
||||||
var IntersectionDict = {"Cord": [], "Data": [] }
|
var IntersectionDict = {"Cord": [], "Data": [] }
|
||||||
@@ -76,6 +76,7 @@ var Root = []
|
|||||||
var FirstGoTo = []
|
var FirstGoTo = []
|
||||||
var AllSetsToGoal = []
|
var AllSetsToGoal = []
|
||||||
var TargetsArray = []
|
var TargetsArray = []
|
||||||
|
var Goal = false
|
||||||
|
|
||||||
func _input(event):
|
func _input(event):
|
||||||
#if Current_Position != TargetCord:
|
#if Current_Position != TargetCord:
|
||||||
@@ -99,7 +100,8 @@ func _input(event):
|
|||||||
AutoSolve()
|
AutoSolve()
|
||||||
|
|
||||||
func _process(delta):
|
func _process(delta):
|
||||||
|
#FoundGoal()
|
||||||
|
AllObjectsFound()
|
||||||
CallableRaycastData()
|
CallableRaycastData()
|
||||||
Mark(Prev_dir)
|
Mark(Prev_dir)
|
||||||
WhatMove()
|
WhatMove()
|
||||||
@@ -117,7 +119,7 @@ func _process(delta):
|
|||||||
IntersectionDumping()
|
IntersectionDumping()
|
||||||
CordsDumping()
|
CordsDumping()
|
||||||
FinishCircling()
|
FinishCircling()
|
||||||
FoundGoal()
|
print(Tree_Array)
|
||||||
#if Detail_Dict.Type == "3 Way Intersection":
|
#if Detail_Dict.Type == "3 Way Intersection":
|
||||||
# print(Individual_Steps)
|
# print(Individual_Steps)
|
||||||
#print(Detail_Dict.Type)
|
#print(Detail_Dict.Type)
|
||||||
@@ -137,11 +139,12 @@ func _process(delta):
|
|||||||
#print(n)
|
#print(n)
|
||||||
#GoBack(n)
|
#GoBack(n)
|
||||||
#print(CordsDump)
|
#print(CordsDump)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
func FoundGoal():
|
func FoundGoal():
|
||||||
if TargetCord.find(Current_Position) != -1 and TargetsArray.find(Current_Position) == -1:
|
if TargetCord.find(Current_Position) != -1 and TargetsArray.find(Current_Position) == -1:
|
||||||
|
Goal = true
|
||||||
print("GOAL!!!!!!!!!!!")
|
print("GOAL!!!!!!!!!!!")
|
||||||
if Done != move:
|
if Done != move:
|
||||||
print("Circling is: ", Cicling)
|
print("Circling is: ", Cicling)
|
||||||
@@ -160,6 +163,10 @@ func FoundGoal():
|
|||||||
|
|
||||||
print("Here is the Set to go to young bull: ",AllSetsToGoal)
|
print("Here is the Set to go to young bull: ",AllSetsToGoal)
|
||||||
Done = move
|
Done = move
|
||||||
|
func AllObjectsFound():
|
||||||
|
if Tree_Array.is_empty() and IntersectionDump.size() > 0:
|
||||||
|
print("Solved")
|
||||||
|
return true
|
||||||
|
|
||||||
|
|
||||||
func Mark(Prev_Direction):
|
func Mark(Prev_Direction):
|
||||||
@@ -459,17 +466,16 @@ func Intersection_Tree():
|
|||||||
Move_Check2 = move
|
Move_Check2 = move
|
||||||
|
|
||||||
func CheckForTreeDeadEnds():
|
func CheckForTreeDeadEnds():
|
||||||
if Tree_Array.size() > 0:
|
if Tree_Array[-1] <= 0:
|
||||||
if Tree_Array[-1] <= 0:
|
Tree_Array[- 1] -= 1
|
||||||
print(Tree_Array)
|
print(Individual_Steps[0])
|
||||||
print(Individual_Steps[0])
|
if Tree_Array.size() > 0:
|
||||||
GoBack(Individual_Steps[0])
|
GoBack(Individual_Steps[0])
|
||||||
Individual_Steps.pop_front()
|
Individual_Steps.pop_front()
|
||||||
Tree_Array.pop_back()
|
Tree_Array.pop_back()
|
||||||
Tree_Array[-1] -= 1
|
print(Tree_Array)
|
||||||
|
else:
|
||||||
else:
|
pass
|
||||||
pass
|
|
||||||
|
|
||||||
func GiveOrder():
|
func GiveOrder():
|
||||||
if Cicling == false:
|
if Cicling == false:
|
||||||
|
|||||||
Reference in New Issue
Block a user