Robocode

Robocode

Robocode is an open source educational game started by Mathew Nelson (originally provided by IBM). Currently contributions are being made by various people; officially Flemming N. Larsen is working on Robocode to keep it current and fix the bugs. The game is designed to help people learn to. In this lesson, we describe the basics of how the scanning works. Your Lab 3 exercise correpsonds to this robocode lesson. Robot Senses. We'll begin this lesson by discussing your robot's senses.

Contents.What is Robocode?Robocode is a where the goal is to code a robot to compete against other robots in a battle arena. The player is the programmer of the robot, who will have no direct influence on the game. Instead, the player must write the of the robot telling it how to behave and react on events occurring in the battle arena. So the name Robocode is a short for 'Robot code'.The game is designed to help you learn Java, and have fun doing it.

Robots are written in the, and the Robocode game can run on any operating system supported by the Java Platform, which includes all common operating systems like Windows, macOS, Linux etc.Robocode's battles take place in a battlefield, where small automated 6-wheeled robots fight it out until only one is left. Please notice that Robocode contains no gore, no blood, no people, and no politics. The battles are simply for the excitement of competition that we love so much. There are explosions, however, but these can be turned off if they are offending.:-)Getting StartedIf you have not done so already, the first step is to Robocode. Once you have installed Robocode, you should to see how it works, then move on to.Brief History of RobocodeThe Robocode game was originally started by Matthew A.

Nelson, aka, as a personal endeavour in late 2000 and became a professional one when he brought it to IBM, in the form of an AlphaWorks download, in July 2001.In the beginning of 2005, Robocode was brought to as Open Source with Robocode version 1.0.7. At this point, the development of Robocode was somewhat stopped.

In the mean while, the Robocode community began to develop their own versions of Robocode in order to get rid of bugs and put new features into Robocode, the and later on the project by.As nothing seemed to happen with Robocode in more than a year, Flemming N. Larsen took over the Robocode project at SourceForge as administrator and developer in July 2006. The RobocodeNG project was dropped, but the Robocode 2006 variant, which contained a lot of contributions from the Robocode community was merged into the official Robocode with version 1.1. Since then, a lot of new versions of Robocode have been released with more and more features and contributions from the community.For more history, read the.ScreenshotsSee also Robocode API.Beginner Guides.External Editors.NET Robots.Links.

JavaScript is disabled on your browser.
  • Class
Robocode codes

Class RobotStatus

    • robocode.RobotStatus
  • All Implemented Interfaces:
    Serializable

    Contains the status of a robot for a specific time/turn returned by StatusEvent.getStatus().
    Since:
    1.5
    Author:
    Flemming N. Larsen (original)
    See Also:
    Serialized Form
    • Method Summary

      All MethodsInstance MethodsConcrete Methods
      Modifier and TypeMethod and Description
      doublegetDistanceRemaining()
      Returns the distance remaining in the robot's current move measured in pixels.
      doublegetEnergy()
      doublegetGunHeading()
      Returns the direction that the robot's gun is facing, in degrees.
      doublegetGunHeadingRadians()
      Returns the direction that the robot's gun is facing, in radians.
      doublegetGunHeat()
      doublegetGunTurnRemaining()
      Returns the angle remaining in the gun's turn, in degrees.
      doublegetGunTurnRemainingRadians()
      Returns the angle remaining in the gun's turn, in radians.
      doublegetHeading()
      Returns the direction that the robot's body is facing, in degrees.
      doublegetHeadingRadians()
      Returns the direction that the robot's body is facing, in radians.
      intgetNumRounds()
      Returns the number of rounds in the current battle.
      intgetNumSentries()
      Returns how many sentry robots that are left in the current round.
      intgetOthers()
      Returns how many opponents that are left in the current round.
      doublegetRadarHeading()
      Returns the direction that the robot's radar is facing, in degrees.
      doublegetRadarHeadingRadians()
      Returns the direction that the robot's radar is facing, in radians.
      doublegetRadarTurnRemaining()
      Returns the angle remaining in the radar's turn, in degrees.
      doublegetRadarTurnRemainingRadians()
      Returns the angle remaining in the radar's turn, in radians.
      intgetRoundNum()
      Returns the current round number (0 to getNumRounds() - 1) of the battle.
      longgetTime()
      Returns the game time of the round, where the time is equal to the current turn in the round.
      doublegetTurnRemaining()
      Returns the angle remaining in the robots's turn, in degrees.
      doublegetTurnRemainingRadians()
      Returns the angle remaining in the robots's turn, in radians.
      doublegetVelocity()
      Returns the velocity of the robot measured in pixels/turn.
      doublegetX()
      Returns the X position of the robot. (0,0) is at the bottom left of the battlefield.
      doublegetY()
      Returns the Y position of the robot. (0,0) is at the bottom left of the battlefield.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getEnergy

        Returns:
        the robot's current energy
      • getX

        Returns the X position of the robot. (0,0) is at the bottom left of the battlefield.
        Returns:
        the X position of the robot
        See Also:
        getY()
      • getY

        Returns the Y position of the robot. (0,0) is at the bottom left of the battlefield.
        Returns:
        the Y position of the robot
        See Also:
        getX()
      • getHeadingRadians

        Returns the direction that the robot's body is facing, in radians. The value returned will be between 0 and 2 * PI (is excluded).

        Note that the heading in Robocode is like a compass, where 0 means North, PI / 2 means East, PI means South, and 3 * PI / 2 means West.

        Returns:
        the direction that the robot's body is facing, in radians.
      • getHeading

        Returns the direction that the robot's body is facing, in degrees. The value returned will be between 0 and 360 (is excluded).

        Note that the heading in Robocode is like a compass, where 0 means North, 90 means East, 180 means South, and 270 means West.

        Returns:
        the direction that the robot's body is facing, in degrees.
      • getGunHeadingRadians

        Returns the direction that the robot's gun is facing, in radians. The value returned will be between 0 and 2 * PI (is excluded).

        Outpost zero game modes. Note that the heading in Robocode is like a compass, where 0 means North, PI / 2 means East, PI means South, and 3 * PI / 2 means West.

        Returns:
        the direction that the robot's gun is facing, in radians.
      • getGunHeading

        Returns the direction that the robot's gun is facing, in degrees. The value returned will be between 0 and 360 (is excluded).

        Note that the heading in Robocode is like a compass, where 0 means North, 90 means East, 180 means South, and 270 means West.

        Returns:
        the direction that the robot's gun is facing, in degrees.
      • getRadarHeadingRadians

        Returns the direction that the robot's radar is facing, in radians. The value returned will be between 0 and 2 * PI (is excluded).

        Note that the heading in Robocode is like a compass, where 0 means North, PI / 2 means East, PI means South, and 3 * PI / 2 means West.

        Returns:
        the direction that the robot's radar is facing, in radians.
      • getRadarHeading

        Returns the direction that the robot's radar is facing, in degrees. The value returned will be between 0 and 360 (is excluded).

        Note that the heading in Robocode is like a compass, where 0 means North, 90 means East, 180 means South, and 270 means West.

        Returns:
        the direction that the robot's radar is facing, in degrees.
      • getVelocity

        Returns the velocity of the robot measured in pixels/turn.

        The maximum velocity of a robot is defined by Rules.MAX_VELOCITY (8 pixels / turn).

        Returns:
        the velocity of the robot measured in pixels/turn
        See Also:
        Rules.MAX_VELOCITY
      • getTurnRemainingRadians

        Returns the angle remaining in the robots's turn, in radians.

        This call returns both positive and negative values. Positive values means that the robot is currently turning to the right. Negative values means that the robot is currently turning to the left.

        Returns:
        the angle remaining in the robots's turn, in radians
      • getTurnRemaining

        Returns the angle remaining in the robots's turn, in degrees.

        This call returns both positive and negative values. Positive values means that the robot is currently turning to the right. Negative values means that the robot is currently turning to the left.

        Returns:
        the angle remaining in the robots's turn, in degrees
      • getRadarTurnRemainingRadians

        Returns the angle remaining in the radar's turn, in radians.

        This call returns both positive and negative values. Positive values means that the radar is currently turning to the right. Negative values means that the radar is currently turning to the left.

        Returns:
        the angle remaining in the radar's turn, in radians
      • getRadarTurnRemaining

        Returns the angle remaining in the radar's turn, in degrees.

        This call returns both positive and negative values. Positive values means that the radar is currently turning to the right. Negative values means that the radar is currently turning to the left.

        Returns:
        the angle remaining in the radar's turn, in degrees
      • getGunTurnRemainingRadians

        Returns the angle remaining in the gun's turn, in radians.

        This call returns both positive and negative values. Positive values means that the gun is currently turning to the right. Negative values means that the gun is currently turning to the left.

        Returns:
        the angle remaining in the gun's turn, in radians
      • getGunTurnRemaining

        Returns the angle remaining in the gun's turn, in degrees.

        This call returns both positive and negative values. Positive values means that the gun is currently turning to the right. Negative values means that the gun is currently turning to the left.

        Returns:
        the angle remaining in the gun's turn, in degrees
      • getDistanceRemaining

        Returns the distance remaining in the robot's current move measured in pixels.

        This call returns both positive and negative values. Positive values means that the robot is currently moving forwards. Negative values means that the robot is currently moving backwards.

        Returns:
        the distance remaining in the robot's current move measured in pixels.
      • getGunHeat

        Returns the current heat of the gun. The gun cannot fire unless this is 0. (Calls to fire will succeed, but will not actually fire unless getGunHeat() 0).

        The amount of gun heat generated when the gun is fired is 1 + (firePower / 5). Each turn the gun heat drops by the amount returned by Robot.getGunCoolingRate(), which is a battle setup.

        Note that all guns are 'hot' at the start of each round, where the gun heat is 3.

        Returns:
        the current gun heat
        See Also:
        Robot.getGunCoolingRate(), Robot.fire(double), Robot.fireBullet(double)
      • getOthers

        Returns how many opponents that are left in the current round.
        Returns:
        how many opponents that are left in the current round.
        Since:
        1.6.2
        See Also:
        getNumSentries()
      • getNumSentries

        Returns how many sentry robots that are left in the current round.
        Returns:
        how many sentry robots that are left in the current round.
        Since:
        1.9.1.0
        See Also:
        getOthers()
      • getNumRounds

        Returns the number of rounds in the current battle.
        Returns:
        the number of rounds in the current battle
        Since:
        1.6.2
        See Also:
        getRoundNum()
      • getRoundNum

        Returns the current round number (0 to getNumRounds() - 1) of the battle.
        Returns:
        the current round number of the battle (zero indexed).
        Since:
        1.6.2
        See Also:
        getNumRounds()
      • getTime

        Returns the game time of the round, where the time is equal to the current turn in the round.
        Returns:
        the game time/turn of the current round.
        Since:
        1.6.2
  • Class
  • Summary:
  • Nested
  • Field
  • Constr
  • Detail:
  • Field
  • Constr

Copyright © 2017 Robocode. All Rights Reserved.

Robocode
© 2020