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
2
votes
1 answer

Robocode - how to calculate rounds won at end of a battle?

I thought I might be able to calculate the rounds won value by subtracting deaths from number of rounds, but my counters are not being incremented: public void onRoundEnded(RoundEndedEvent event) { roundCount++; } public void…
lepton
  • 715
  • 1
  • 6
  • 22
2
votes
2 answers

Refresh Java argument

I am writing a program for a programming game called robocode. The problem is here: void wallScan(boolean While){ stop(); getStraight(); turnGunRight(90); if(startabsolute){ straight=true; } while (While){ …
Moyamo
  • 358
  • 2
  • 10
2
votes
1 answer

How to fix angular precision at robocode ?

I've just started playing robocode and I've encountered this angle problem at my first robot project. I've wright following code in order to shot enemies nearby ; public void onScannedRobot(ScannedRobotEvent e) { double radarAngle ; double…
Capan
  • 686
  • 1
  • 14
  • 32
2
votes
2 answers

Error while starting RoboCode

I am getting the following error while trying to run Robocode.bat error: could not find or load main class robocode.robocode I checked the java Installation, I checked it in the java website, the installation is fine. I also added the path in…
Ajay Bhasy
  • 1,920
  • 1
  • 26
  • 38
2
votes
1 answer

robocode engine: how to design (write) the runtime engine -- the robot world

IBM has (had) a free learn-Java program called RoboCode, in which custom robots could be written that would then do battle in a 2D space. I would like to write the environment that supports such robots, but don't know what pattern or design to use.…
Bob
  • 21
  • 2
1
vote
1 answer

Why is fire being delayed in robocode

package com.gshs; import robocode.*; public class Gshs_21043 extends Robot { public void run() { while(true) { turnRadarRight(90); } } public void…
1
vote
1 answer

Robocode Robot with Drools Expert

i have a class assignment to create a Robot using Drools as an inference machine. however, most of my rules act strange since they don't fire for the class but fire for it's superclass. Something like this: my rules: import…
1
vote
1 answer

How to solve the 'could not find or load main class robocode.robocode' error?

I am now a starter in Robocode and now I am trying to run my first robot from Eclipse. I have followed the tutorial on Robocodewiki but the Eclipse keep reporting Error: Could not find or load main class robocode.Robocode Caused by:…
Momomo
  • 21
  • 3
1
vote
3 answers

How to resolve "the Syntax error, static imports are only available if source level is 1.5 or greater "in java on Robocode

I am trying to compile the robot on the robocode, but It said that "static imports are only available if source level is 1.5 or greater" I did not understand what it means. I saw in others forums that can be the update of Java, but my computer…
1
vote
0 answers

Exception in Ahead() method

I have created AdvancedRobot. After first round in Run() I have got exceptions from Ahead method. public override void Run() { //... var moveAmount = Math.Max(BattleFieldWidth, BattleFieldHeight); Ahead(moveAmount); …
Kamil
  • 49
  • 1
  • 5
1
vote
1 answer

Linear targeting in robocode

Can anyone explain me this code? i don't understand condition in the loop while and "predicted X". why predicted_X < 18? what does 18 mean? while((++deltaTime)*BULLET_SPEED < Point2D.Double.distance(myX, myY, predictedX, predictedY)) { …
AnNg
  • 75
  • 2
  • 6
1
vote
1 answer

Robocode libraries cannot be found by Robot upon runtime

I have the programming game 'Robocode' in my project root so I can run the project anywhere and not have it installed in C:/robocode. I have a run configuration with the following options; Main Class: robocode.Robocode VM Options: -Xmx512M…
TomPlum
  • 135
  • 1
  • 14
1
vote
1 answer

Using setFire, setAhead, etc, without calling execute()

I'm extending an open-source AdvancedRobot in Robocode. That robot uses setFire to shoot, but never calls execute (doesn't appear in the code). I'm wondering how it's possible to still be able to shoot (it does). SetFire's doc says : This call…
LogicalKip
  • 514
  • 4
  • 13
1
vote
1 answer

Singleton pattern in Robocode

I was trying to implement singleton pattern in Robocode. But unfortunately, when new round starts, every time a new object (which is singleton) is created. Do you know if it is possible to use singleton pattern in Robocode? If not, could you…
Kris
  • 1,538
  • 2
  • 16
  • 27
1
vote
1 answer

JGAP Robocode User Guide

I've had a look at the JGAP package from the robocode website and I have been getting problems when attempting to set it up. It seems that some of the files that are talked about are not actually in the download. For instance the line on the website…
Glympse
  • 107
  • 1
  • 7