Questions tagged [robocode]

Robocode is a programming game, where the goal is to develop a robot battle tank to battle against other tanks in Java or .NET. The robot battles are running in real-time and on-screen.

Robocode is a programming game, where the goal is to develop a robot battle tank to battle against other tanks in Java or .NET. The robot battles are running in real-time and on-screen.

74 questions
0
votes
2 answers

Robocode: precision of onScannedRobot

I wrote a relatively simple AdvancedRobot that turns its radar around and records all enemies with their velocities. Eventually, I noticed that the robot misses in cases where it's not supposed to miss. I copied the code from Robocode/Graphical…
user1334767
  • 587
  • 4
  • 17
0
votes
1 answer

Why robocode is not starting?

I have installed latest Java version then tried to install Robocode from terminal and from sourceforge but in first case i got an error: java.lang.ClassNotFoundException: net.sf.robocode.core.RobocodeMainBase at…
SgerS1
  • 131
  • 5
0
votes
1 answer

Cant package my robot

I'm trying to package a robocode robot created with .Net but it does not appear on my list under the "Package robot or team" window. I am using VisualStudio 2013 with .Net 2.0 to create the DLL. I have the DLL in my robots folder and I can select it…
0
votes
1 answer

Class Self-Reference

I have the following code. The angle function needs some information from the class it was called from. What's the best way to do this? class MyScannedRobotEvent extends robocode.ScannedRobotEvent { public int angle(robocode.Robot myRobot) { …
Free Bullets
  • 127
  • 1
  • 1
  • 6
0
votes
1 answer

Importing a jar file into robocode doesnt work

I am using robocode 1.9.2.6 I created a simple maven project for my robot. When I import the generated the jar into Robocode UI, Robot-> Import Robot. It says robot imported successfully and the jar file is copied into the robots folder. After that…
Subba Rao
  • 165
  • 14
0
votes
0 answers

How would I prevent my robot from touching a certain line?

I'm quite new to java and robocode, so please bear with me if my questions are dumb. I can calculate a line in which the opponent's bullet will travel, but I was wondering how I would go about storing and moving the robot so it doesn't touch any of…
0
votes
2 answers

Robocode Responsive Turning

I'm trying to make a robot for robocode that always turns perpendicular when it sees a robot. If you don't know what robocode is just imagine a top down game where direction is recorded in degrees I've already made an equation that does what I want…
Hash
  • 39
  • 4
0
votes
1 answer

How to make virtual key small later?

How to make small vk letters like case VK_k instead of VK_K? using Switch Case Thanks public void onKeyPressed(KeyEvent e){ switch(e.getKeyCode()){ case VK_K: moveDirection=1; moveAmount =…
NL_FH
  • 3
  • 4
0
votes
1 answer

onScannedRobot method not being called in Robocode

I am creating a simple robot in Robocode. I have a function walls shown below: public void walls() { see = false; wallBool = true; double maxMove = Math.max(getBattleFieldWidth(), getBattleFieldHeight()); …
Eragon20
  • 483
  • 1
  • 7
  • 20
0
votes
2 answers

Is it possible to call a robot method outside of "main" robot class?

I'm trying to make a robot in the robocode environment. My question is, if I want (for example) to call the method "fire()" outside of my robot class (so the class that extends Robot and has the run, onHitBybullet, ... methods), how do I do it?…
Dominus
  • 808
  • 11
  • 25
0
votes
1 answer

Running batch file from java causes hang, but not when running it normally

I am running a batch file which runs a battle in Robocode from within java, and then collecting the results of the battle. The code I am using to run the batch file is: Process p = Runtime.getRuntime().exec("cmd /c…
Pottsiex5
  • 487
  • 2
  • 6
  • 19
0
votes
1 answer

Robocode HashTable/method modifying values in it issues

Currently in RObocode I have a hashtable that has names as the keys and point2D objects as the values. One of the properties of these objects is the double lastSeen which is the time since the robot has been seen. Everytime I scan a robot, I would…
kevin shen
  • 61
  • 6
0
votes
1 answer

onScannedRobot method never being called

Have tried debugging by using System.out to check whether a method is run or not. The run method executes fine and the radar begins spinning with the robot console displaying Hello. onScannedRobot seems to be never called. Completely out of a clue…
kevin shen
  • 61
  • 6
0
votes
1 answer

Robocode run in eclipse

I started to code robocode with eclipse. But whenever i run the program from eclipse it gives error, Error: Main method not found in class robo_first.robo_new, please define the main method as: public static void main(String[] args) or a JavaFX…
Sameera Kumarasingha
  • 2,908
  • 3
  • 25
  • 41
0
votes
1 answer

I do not understand why when I run this code it never goes into the onScannedRobot(ScannedRobot e) method?

I'm am using the environment Robocode in Java and am trying to create a robot to go up against the sample robot spinbot. I am calculating the center of the circle that the spinbot goes around and using that to aim at to get the best chances of…
Laura
  • 11
  • 1