49 lines
1.5 KiB
Plaintext
49 lines
1.5 KiB
Plaintext
Tree("Root") {
|
|
Decorator (LoopInFrame) {
|
|
Composite (Sequence) {
|
|
ManualTick.AlignDirection()
|
|
RunTree("FollowLeftWall")
|
|
}
|
|
}
|
|
}
|
|
|
|
Tree("FollowLeftWall") {
|
|
Composite (Selector) {
|
|
Composite (Sequence) {
|
|
ManualTick.FpsCounter()
|
|
ManualTick.Fail()
|
|
}
|
|
|
|
Composite (Sequence) {
|
|
ManualTick.CheckDirectionFree(0,-1) // left
|
|
ManualTick.CheckDirectionFree(1,0) // front
|
|
ManualTick.CheckDirectionOccupied(1,-1) // front/left
|
|
ManualTick.MoveDirection()
|
|
ManualTick.DebugLog("1")
|
|
}
|
|
Composite (Sequence) {
|
|
ManualTick.CheckDirectionFree(0,-1) // left
|
|
ManualTick.CheckDirectionOccupied(-1,-1) // back/left
|
|
ManualTick.TurnLeft()
|
|
ManualTick.DebugLog("2")
|
|
}
|
|
Composite (Sequence) {
|
|
ManualTick.CheckDirectionOccupied(0,-1) // left
|
|
ManualTick.CheckDirectionFree(1,0) // front
|
|
ManualTick.MoveDirection()
|
|
ManualTick.DebugLog("3")
|
|
}
|
|
Composite (Sequence) {
|
|
ManualTick.CheckDirectionOccupied(0,-1) // left
|
|
ManualTick.CheckDirectionOccupied(1,0) // front
|
|
ManualTick.TurnRight()
|
|
ManualTick.DebugLog("4")
|
|
}
|
|
Composite (Sequence) {
|
|
ManualTick.CheckDirectionOccupied(1,0) // front
|
|
ManualTick.CheckDirectionFree(0,-1) // left
|
|
ManualTick.TurnRight()
|
|
ManualTick.DebugLog("5")
|
|
}
|
|
}
|
|
} |