Package robocode

Class HitWallEvent

java.lang.Object
robocode.Event
robocode.HitWallEvent
All Implemented Interfaces:
Serializable, Comparable<Event>

public final class HitWallEvent extends Event
A HitWallEvent is sent to onHitWall() when you collide a wall. You can use the information contained in this event to determine what to do.
Author:
Mathew A. Nelson (original), Flemming N. Larsen (contributor)
See Also:
  • Constructor Details

    • HitWallEvent

      public HitWallEvent(double bearing)
      Called by the game to create a new HitWallEvent.
      Parameters:
      bearing - the bearing to the wall that your robot hit, in radians
  • Method Details

    • getBearing

      public double getBearing()
      Returns the bearing to the wall you hit, relative to your robot's heading, in degrees (-180 invalid input: '<'= getBearing() invalid input: '<' 180)
      Returns:
      the bearing to the wall you hit, in degrees
    • getBearingDegrees

      @Deprecated public double getBearingDegrees()
      Deprecated.
      Use getBearing() instead.
      Returns:
      the bearing to the wall you hit, in degrees
    • getBearingRadians

      public double getBearingRadians()
      Returns the bearing to the wall you hit, relative to your robot's heading, in radians (-PI invalid input: '<'= getBearingRadians() invalid input: '<' PI)
      Returns:
      the bearing to the wall you hit, in radians