AI CHOREOGRAPHY / STUDY / LEVEL 3 OF 7

Scoring
a pose.

When does a pose count? The game's answer has four parts: both hands inside their targets, held for a moment, late enough in the pose that you actually followed it, and a real squat when the pose asks for one. Then scoreRules.js grades the hit, multiplies it by your combo and, after 24 poses, decides whether you won.

distanceeach hand within 0.28 m of its target
→
holdboth inside for 0.12 s, after beat 0.7
→
gradePERFECT if well centred and early, else GOOD
→
roundcombo multiplier, 24 poses, win line, rank

A. Match the pose

Free practice

Drag the two coloured dots (your hands) into the dashed rings, or tick "ghost hands" and watch. The bar at the bottom is the current pose's two beats.

This pose

coach.js step 4
u (beats into pose)
held (nearT)
left distance
right distance
closeness
result

B. A whole round in one click

RoundScore from scoreRules.js

Choose how a player tends to do, then simulate 24 poses. Every hit goes through the real gradeOf and RoundScore.hit; every miss through RoundScore.miss.

Not simulated yet.
The combo multiplier

The real code

scoreRules.js

Pure rules: no graphics, no controllers. The highlighted lines are the ones this page calls.


      

Where the scene judges a pose

coach.js

This page runs a copy of these lines, because the scene itself needs a headset.


      
    

What you should be able to explain

  1. A hit needs four conditions. Both hands within TOL (0.28 m, measured in 3D, so reaching too far forward also counts against you); a squat when the pose has squat; held for 0.12 s (nearT), so swinging through a target does not count; and only after 0.7 beat, when the coach has finished sliding into the pose.
  2. Grades. closeness is 1 at the centre and 0 at the edge, averaged over both hands. PERFECT needs closeness ≥ 0.45 and a hit by 1.4 beats: accurate and on time. Anything else that counts is GOOD.
  3. Combo and multiplier. Each hit in a row adds to the combo; every fourth raises the multiplier by 0.25, up to ×2. A miss resets it. That is why consistency beats occasional perfection.
  4. A round is just numbers on the pose clock. {k0, n}: the first scored pose and how many. roundPhase compares them with the current pose number k, which is why every player agrees when the round starts and ends (see Level 7).

Exercises: ① Drag a hand so its dot sits just inside the ring's edge: do you get PERFECT or GOOD? Why? ② Switch to Fitness, reach a squat pose and leave "you are squatting" off. What happens? ③ In part B, find the lowest hit rate that still wins with closeness 0.55. Then lower closeness to 0.3: does the hit rate you need change? Explain using the multiplier table.