Thursday, January 9, 2014

Day 4 Plans: Animation, Rotation, Domination!

The first order of business today is making my dancers move between spaces, rather than just appear there. I'm going to do this by giving each dancer a "goal" intrinsic to them. When you hit a button that requires them to move somewhere, the goal changes, and as long as current position =! goal, they will move toward the goal at their maximum speed.

THEN, the complicated part: I want to animate rotation. Still not quite sure how I'm going to accomplish this one.

Once I've got both straight-line swaps and rotation around a point, I can start making functions for a lot of the different moves--swings, allemandes, chains, etc. The only things left will be a) moves that involve the entire hands-4 (circles and stars) and making sure that when swinging, the lady ends up on the right.

An easy way to accomplish either of these would be to label the positions of the hands-4 0, 1, 2, and 3; then to circle, each dancer moves to (its position + 1, mod 4). In a swing, check to see if the lady is in position (gent position + 1, mod 4)--if so, swap and even number of times, and if not, swap an odd number of times.

It gets tricky depending on just how much functionality I want the dance simulator to have, though. If there's a swing that ends in a long line of four, it'll require more spaces than just those four, and a way to check lady-on-the-right-ness of those. If there's a wavy line, dancers will occupy spaces in between the four basic ones. I think I need a second opinion.

Anyway, onward and upward! Plan of attack:
1. straight-line animation
2. rotation animation
3. build allemande/gypsy (essentially identical) functions that take as parameters the dancers participating, the direction, and the number of times around (built up using the smaller functions Swap and Rotate)
(3.5. if feeling inventive, start a ladies chain function, which requires the ladies to swap and then the gent+lady pair to do a half-circle. This SHOULD be doable using existing rotation animation, but might require extra stuff.)
4. Start working on position numbering for swings? Or find another way to do this?

No comments:

Post a Comment