-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# TC技术挑战赛脚本 | ||
* 2024 | ||
* TC2024Attack 用于测试TC2024的进攻脚本 | ||
* TC2024DefenseA 场景A的防守脚本,自动调用ZJRoboCon2024TC作为裁判脚本 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
local ORIGIN = CGeoPoint:new_local(0,0) | ||
local CIRCLE_DIST = 1500 | ||
local WAIT_POS = { | ||
ORIGIN + Utils.Polar2Vector(CIRCLE_DIST, 0*math.pi*2/3), | ||
ORIGIN + Utils.Polar2Vector(CIRCLE_DIST, 1*math.pi*2/3), | ||
ORIGIN + Utils.Polar2Vector(CIRCLE_DIST, 2*math.pi*2/3), | ||
} | ||
return { | ||
firstState = "init", | ||
["init"] = { | ||
switch = function() | ||
if player.toTargetDist("a") < 10 then | ||
return "kickA" | ||
end | ||
end, | ||
a = task.goCmuRush(WAIT_POS[1]), | ||
b = task.goCmuRush(WAIT_POS[2]), | ||
c = task.goCmuRush(WAIT_POS[3]), | ||
match = "[abc]" | ||
}, | ||
["kickA"] = { | ||
switch = function() | ||
if player.kickBall("a") then | ||
return "kickB" | ||
end | ||
end, | ||
a = task.touchKick(WAIT_POS[2],false,4000,true), | ||
b = task.goCmuRush(WAIT_POS[2]), | ||
c = task.goCmuRush(WAIT_POS[3]), | ||
match = "{abc}", | ||
}, | ||
["kickB"] = { | ||
switch = function() | ||
if player.kickBall("b") then | ||
return "kickA" | ||
end | ||
end, | ||
b = task.touchKick(WAIT_POS[1],false,4000,true), | ||
a = task.goCmuRush(WAIT_POS[1]), | ||
c = task.goCmuRush(WAIT_POS[3]), | ||
match = "{abc}", | ||
}, | ||
name = "TC2024Attack", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
local ORIGIN = CGeoPoint:new_local(0,0) | ||
local RUN_DIST = 1200 | ||
local RUN_POS = { | ||
ORIGIN + Utils.Polar2Vector(RUN_DIST, 0*math.pi*2/3), | ||
ORIGIN + Utils.Polar2Vector(RUN_DIST, 1*math.pi*2/3), | ||
ORIGIN + Utils.Polar2Vector(RUN_DIST, 2*math.pi*2/3), | ||
} | ||
return { | ||
firstState = "reset", | ||
["reset"] = { | ||
switch = function() | ||
gSubPlay.new("TC", "ZJRoboCon2024TC") | ||
return "run" | ||
end, | ||
a = task.stop(), | ||
match = "(a)" | ||
}, | ||
["wait"] = { | ||
switch = function() | ||
return gSubPlay.getState("TC") == "run" and "run" or "wait" | ||
end, | ||
a = task.goCmuRush(ORIGIN,0), | ||
match = "(a)" | ||
}, | ||
["run"] = { | ||
switch = function() | ||
return gSubPlay.getState("TC") == "run" and "run" or "wait" | ||
end, | ||
a = task.runMultiPos(RUN_POS,true,30,0), | ||
match = "(a)" | ||
}, | ||
name = "TC2024DefenseA", | ||
} |