https://github.com/chunrapeepat/robocode
The Robot Of Robocoding created by Chunza2542
https://github.com/chunrapeepat/robocode
Last synced: 8 months ago
JSON representation
The Robot Of Robocoding created by Chunza2542
- Host: GitHub
- URL: https://github.com/chunrapeepat/robocode
- Owner: chunrapeepat
- Created: 2016-01-31T08:36:27.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-02-03T13:42:39.000Z (over 10 years ago)
- Last Synced: 2025-02-12T02:55:50.321Z (over 1 year ago)
- Language: Java
- Size: 5.86 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Robocode
The Robot created by Chunza2542 (Chun Rapeepat)
* Usage [Installation the robot]
import robocode.util.Utils;
public class extends AdvancedRobot
* Methods [Methods description]
-setAdjust ... For ... Turn(true); //Sets the .... to turn independent from the ..... turn.
-getX(), getY // get x,y left bottom is (0,0)
-getBattleFieldWidth(),getBattleFieldHeight() //Get width & Height of BattleField
-getRadarTurnRemaining() //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.
-execute() //continues executing actions that are in process. This call returns after the actions have been started.
-Utils.normalRelativeAngleDegrees // -180 to 180
-Utils.normalRelativeAngleDegrees // -180 to 180
EX.//เซ็ตตัวแปร "องศาที่เรดาร์จะต้องหมุนเพิ่ม" ให้เท่ากับ
double radarTurn =
// องศาที่ตัวหุ่นยนต์ของเราหันอยู่เมื่อเทียบกับสนามรบ + องศาที่จุดค้นพบศัตรูเทียบกับองศาที่ตัวหุ่นยนต์เราหันอยู่
getHeadingRadians() + e.getBearingRadians()
// ลบด้วยองศาที่เรดาร์กำลังหันไปอยู่
- getRadarHeadingRadians();
//หมุนเรดาร์ไปทางขวาตามค่าของตัวแปร "องศาที่เรดาร์จะต้องหมุนเพิ่ม"
setTurnRadarRightRadians(Utils.normalRelativeAngle(radarTurn));