[code]package jm;
import robocode.*;
public class Wing_Gundam_Zero_Custom extends AdvanceRobot
{
private int hitCount;
public void run() {
setTurnGunRight (Double.POSITIVE_INFINITY);
while (true) {
double direction = getHeading();
double amount = Math.abs (270 - direction);
if (direction > 270)
turnLeft (amount);
else
turnRight (amount);
ahead(getX());
turnGunRight(90);
ahead(getBatleFieldHeight() - getY());
turnGunRight(90);
ahead(getBatleFieldWidth());
turnGunRight(90);
ahead(getBatleFieldHeight());
turnGunRight(90);
ahead(getBatleFieldWidth());
}
}
public void onScannedRobot(ScannedRobotEvent e) {
if (e.getBearing()>-10 && e.getBearing() <10)
fire(3);
else
fire(2);
}
public void onHitByBullet(HitByBulletEvent e) {
if (hitCount < 3)
hitCount++;
else
{
turnRight(45);
ahead(100);
hitCount = 0;
}
}
}
[/code]
esse é meu codigo do meu Robocode, mas nao ta compilando nao sei oq é, e eu tbm queria q alguem me ajudasse a melhorar ele, por favor me ajudem…
Abaixo eu coloquei os Erros…
[code]Compiling…
Found 19 semantic errors compiling "C:/robocode/robots/jm/Wing_Gundam_Zero_Custom.java":
4. public class Wing_Gundam_Zero_Custom extends AdvanceRobot
<---------->
*** Error: Type jm/AdvanceRobot was not found.
9. setTurnGunRight (Double.POSITIVE_INFINITY);
<---------------------------------------->
*** Error: No method named "setTurnGunRight" was found in type "jm/Wing_Gundam_Zero_Custom".
12. double direction = getHeading();
<---------->
*** Error: No method named "getHeading" was found in type "jm/Wing_Gundam_Zero_Custom".
16. turnLeft (amount);
<--------------->
*** Error: No method named "turnLeft" was found in type "jm/Wing_Gundam_Zero_Custom".
18. turnRight (amount);
<---------------->
*** Error: No method named "turnRight" was found in type "jm/Wing_Gundam_Zero_Custom".
20. ahead(getX());
<---->
*** Error: No method named "getX" was found in type "jm/Wing_Gundam_Zero_Custom".
21. turnGunRight(90);
<-------------->
*** Error: No method named "turnGunRight" was found in type "jm/Wing_Gundam_Zero_Custom".
22. ahead(getBatleFieldHeight() - getY());
<------------------->
*** Error: No method named "getBatleFieldHeight" was found in type "jm/Wing_Gundam_Zero_Custom".
22. ahead(getBatleFieldHeight() - getY());
<---->
*** Error: No method named "getY" was found in type "jm/Wing_Gundam_Zero_Custom".
24. turnGunRight(90);
<-------------->
*** Error: No method named "turnGunRight" was found in type "jm/Wing_Gundam_Zero_Custom".
25. ahead(getBatleFieldWidth());
<------------------>
*** Error: No method named "getBatleFieldWidth" was found in type "jm/Wing_Gundam_Zero_Custom".
27. turnGunRight(90);
<-------------->
*** Error: No method named "turnGunRight" was found in type "jm/Wing_Gundam_Zero_Custom".
28. ahead(getBatleFieldHeight());
<------------------->
*** Error: No method named "getBatleFieldHeight" was found in type "jm/Wing_Gundam_Zero_Custom".
30. turnGunRight(90);
<-------------->
*** Error: No method named "turnGunRight" was found in type "jm/Wing_Gundam_Zero_Custom".
31. ahead(getBatleFieldWidth());
<------------------>
*** Error: No method named "getBatleFieldWidth" was found in type "jm/Wing_Gundam_Zero_Custom".
38. fire(3);
<----->
*** Error: No method named "fire" was found in type "jm/Wing_Gundam_Zero_Custom".
40. fire(2);
<----->
*** Error: No method named "fire" was found in type "jm/Wing_Gundam_Zero_Custom".
49. turnRight(45);
<----------->
*** Error: No method named "turnRight" was found in type "jm/Wing_Gundam_Zero_Custom".
50. ahead(100);
<-------->
*** Error: No method named "ahead" was found in type "jm/Wing_Gundam_Zero_Custom".
Compile Failed (1)
[/code][/quote]