/* used in surface and homeomorphism.htm */
import java.awt.*;
import primitives.frames.Frames;
//import primitives.spaces.*;
import primitives.machines.TwolegsMachine;
/* applet appears in surfaces and homemorphism.htm*/

public class TwoLegDemo extends Frames {
	private	double  d = Math.PI/2;
	private TwolegsMachine machine;
	public void start(){
			run = true;
		machine = new TwolegsMachine(frames[0].drawArea.getSize(),getParam("legs",2));
		frames[0].drawArea.setCurrentObject(machine);
		startThread();
	}
	public void changeFrames(){
		if(machine.legs>2)machine.rotateJoint(2,0.2);
		machine.rotateJoint(1,(-0.4)*Math.sin(d));
				d = d+0.05;				
				machine.rotateJoint(0,0.1);
				frames[0].drawArea.repaint();
		}
	public void stop(){
		super.stop();
		machine = null;
	}
}

		