Rotating Pills CSE 115 Fall 2006 – Lab 10 Dr. Mario

advertisement

Rotating Pills

CSE 115 Fall 2006

Dr. Mario – Lab 10

Pills

 Made up of two pill segments

 Pills are positioned initially horizontally

 Pill segment 1 is on the left, pill segment 2 is on the right

 Has a state controlling how to rotate.

Rotate clockwise (A button)

 Corresponds to the old A button on the

Nintendo controller

 If user selects, delegates to the states’ rotateA method

 Depending on the state, the pill segments will switch positions and orientation of the pill will switch (by switching the rotation state)

Rotating clockwise (Basic example)

 P1 | P2 (P1 in column 2, P2 in column 3)

 P1

P2 (both in column 2)

 P1

P2 (both in column 2)

 P2|P1 (P2 in column 2, P1 in column 3)

Rotate counter-clockwise (B button)

 Corresponds to the B button on the old

Nintendo controller

 If user selects, delegates to state’s rotate

B method

 Depending on the state, the pill segments will switch positions and orientation of the pill will switch (by switching the rotation state)

Rotating counter-clockwise (Basic example)

 P1 | P2 (P1 in column 4, P2 in column 5)

 P2

P1 (both in column 4)

 P2

P1 (both in column 4)

 P2|P1 (P2 in column 4, P1 in column 5)

Download