Inspect rapid-count board through native yaw and pitch views
This commit is contained in:
@@ -10,12 +10,14 @@ function BallRadiusPixels($CurrentBoard,$Ball) {
|
||||
$local=[Numerics.Vector3]::Transform([Numerics.Vector3]::new($Ball.position.x,$Ball.position.y,$Ball.position.z)-$origin,[Numerics.Quaternion]::Inverse($rotation))
|
||||
return 540*.55/([Math]::Tan(31*[Math]::PI/180)*$local.Z)
|
||||
}
|
||||
function Orbit([string]$Name,$CurrentBoard) {
|
||||
function Orbit([string]$Name,$CurrentBoard,[switch]$Pitch) {
|
||||
if(!$CurrentBoard){$saved=Save "$Name-view";$CurrentBoard=if($saved.puzzleStates.Count){$saved.puzzleStates[-1]}else{$saved.latestFreePlay}}
|
||||
$points=@($CurrentBoard.balls|ForEach-Object{,(BallPoint $CurrentBoard $_.id)})
|
||||
foreach($y in @(300,700)){foreach($x in @(650,900,1150,1400,1650)){
|
||||
if(@($points|Where-Object{[Math]::Pow($_[0]-$x,2)+[Math]::Pow($_[1]-$y,2)-lt22500}).Count-eq0){
|
||||
Step $Name @('shell','input','swipe',"$x","$y","$($x+120)","$y",'350');return
|
||||
$endX=if($Pitch){$x}else{$x+120};$endY=if($Pitch){$y+120}else{$y}
|
||||
if($endY-gt750){continue}
|
||||
Step $Name @('shell','input','swipe',"$x","$y","$endX","$endY",'350');return
|
||||
}
|
||||
}}
|
||||
throw 'No safe blank orbit start in the actual board view.'
|
||||
@@ -163,7 +165,7 @@ try {
|
||||
if($stage-eq20) {
|
||||
# Cache projected coordinates, then only native taps during speech; duplicates must not queue another word.
|
||||
$visible=$false
|
||||
for($view=0;$view-lt24;$view++){
|
||||
for($view=0;$view-lt48;$view++){
|
||||
$actual=Board (Save "twenty-before-rapid-view-$view") 20
|
||||
$points=@($actual.balls|ForEach-Object{,(BallPoint $actual $_.id)})
|
||||
$visible=@($points|Where-Object{!(WorldSafe $_)}).Count-eq0
|
||||
@@ -172,7 +174,8 @@ try {
|
||||
$centreDistanceSquared=[Math]::Pow($points[$a][0]-$points[$b][0],2)+[Math]::Pow($points[$a][1]-$points[$b][1],2)
|
||||
if($centreDistanceSquared-lt[Math]::Pow([Math]::Max($radii[$a],$radii[$b])+8,2)){$visible=$false}
|
||||
}}
|
||||
if($visible){break};Orbit "twenty-rapid-safe-view-$view" $actual
|
||||
if($visible){break}
|
||||
Orbit "twenty-rapid-safe-view-$view" $actual -Pitch:($view%12-eq11)
|
||||
}
|
||||
Check 'twenty-all-ten-safe-separated-projections' $visible ($points|ConvertTo-Json -Compress)
|
||||
StartAudio 'audio-ten-rapid' 24
|
||||
|
||||
Reference in New Issue
Block a user