home *** CD-ROM | disk | FTP | other *** search
- import java.applet.Applet;
- import java.awt.Button;
- import java.awt.Container;
- import java.awt.Event;
- import java.awt.GridLayout;
-
- public class VRCJuice extends Applet {
- VRCRobot VRCRobo;
- boolean INIT = false;
-
- public void init() {
- ((Container)this).setLayout(new GridLayout(1, 3));
- ((Container)this).add("a", new Button("Right Arm"));
- ((Container)this).add("b", new Button("Right Leg"));
- ((Container)this).add("c", new Button("Torso"));
- ((Container)this).add("d", new Button("Left Leg"));
- ((Container)this).add("e", new Button("Left Arm"));
- ((Container)this).add("i", new Button("Color"));
- ((Container)this).add("f", new Button("Animate"));
- ((Container)this).add("h", new Button("Walk"));
- ((Container)this).add("g", new Button("Restart"));
- }
-
- public void destroy() {
- this.VRCRobo.destroy();
- System.gc();
- this.INIT = false;
- }
-
- public boolean action(Event var1, Object var2) {
- if (var1.target instanceof Button) {
- if (!this.INIT) {
- this.VRCRobo = new VRCRobot();
- this.INIT = true;
- }
-
- String var3 = (String)var2;
- if (var3.equals("Right Arm")) {
- this.VRCRobo.asyncRWave();
- } else if (var3.equals("Left Arm")) {
- this.VRCRobo.asyncLWave();
- } else if (var3.equals("Left Leg")) {
- this.VRCRobo.asyncLLeg();
- } else if (var3.equals("Right Leg")) {
- this.VRCRobo.asyncRLeg();
- } else if (var3.equals("Restart")) {
- this.destroy();
- } else if (var3.equals("Torso")) {
- this.VRCRobo.twist(-1);
- this.VRCRobo.twist(1);
- } else if (var3.equals("Animate")) {
- this.VRCRobo.asyncAnimate();
- } else if (var3.equals("Walk")) {
- this.VRCRobo.asyncWalk();
- } else if (var3.equals("Color")) {
- this.VRCRobo.asyncColor();
- }
- }
-
- return true;
- }
- }
-