Package robocode

Examples of robocode.Condition


    setRadarColor(Color.white);

    // Initially, we'll move when life hits 80
    trigger = 80;
    // Add a custom event named "trigger hit",
    addCustomEvent(new Condition("triggerhit") {
      public boolean test() {
        return (getEnergy() <= trigger);
      }
    });
  }
View Full Code Here


*/
public class CustomEvents extends AdvancedRobot {
  @Override
  public void run() {

    addCustomEvent(new Condition("onTick99", 99) {
      public boolean test() {
        return true;
      }
    });

    addCustomEvent(new Condition("onTick30", 30) {
      public boolean test() {
        return true;
      }
    });

    addCustomEvent(new Condition("onLowEnergy98", 98) {
      public boolean test() {
        return getEnergy() < 20;
      }
    });
    while (true) {
View Full Code Here

TOP

Related Classes of robocode.Condition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.