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

How can I set alpha color on Robocode?

I built a robot in Robocode and I want it to have custom colors, more specifically using RGBA. Is that possible? I tried: setBodyColor(Color.fromArgb(150, 0, 150)); setBodyColor(Color(0.0f,0.0f,0.0f,0.0f)); But neither worked. Any suggestions?
Roger Oba
  • 1,292
  • 14
  • 28
0
votes
2 answers

Robocode Enemy class setDirection() calling

I'm programming Robocode and now I have a coding question: I defined class Enemy to store enemy information (such as heading, bearing, velocity etc.) and in this class I also defined a private attribute named direction. Then I use the public getters…
0
votes
1 answer

Problems when using robocode with JESS

I'm attempting to use JESS in order to utilise a rule-based system for making a robot. I've got both robocode and the JESS .jar imported into Eclipse. Here's my code - public class myRobot extends Robot { Rete r = new Rete(); public void…
0
votes
0 answers

Multiple classes Robcode .NET

So i have an assigment where i am going to program an AI using Robocode with .NET C#. Using what i have learned at school, i want to create a few classes for different state machines. In each class i have a update method that takes in an advanced…
0
votes
2 answers

Compile-time error in immutable class: (final) variable might not have been initialized

The code is as simple as it can possibly get, but I seem to be getting a compiler error. What did I miss? As a side-note, removing the _name field altogether simply generates the same error on the next field. P.S.: Expecting quite a few minus votes…
Maxim Kumpan
  • 2,545
  • 2
  • 19
  • 23
0
votes
0 answers

Return coordinates of a tank

I have written some code to move a tank to specific point. First I've made a wall stick and programmed it to find out when the tank moves to the bottom-left. The tank's coordinate is (18,18), but when I use getWidth() and getHeight() function it…
if_
  • 13
  • 4
0
votes
0 answers

Scala and Robocode- ClassCircularityError

this is my code def main(args: Array[String]): Unit = { val engine = new RobocodeEngine def rounds = 1 val battlefield = new BattlefieldSpecification(1000, 500) //val robots = engine.getLocalRepository() engine.setVisible(true) …
Chobeat
  • 3,445
  • 6
  • 41
  • 59
0
votes
1 answer

Robocode: How can I programatically compile a robot?

I have created a program which generates Robocode robots, saving them as the usual .java files. The issue I am having is compiling them to be used in battles! I need to do this automatically in code, but can't quite work it out. Thanks!
user1966361
  • 179
  • 1
  • 3
  • 14
0
votes
1 answer

Robocode instadd issue in windows 7 for .Net platform

I want developing the robocode base on .Net platform, but I meet a issue to starting it. I had installed Java and .Net 4.0 on my machine. After download and installed the robocode-1.7.4.4-setup.jar, the robocode application can working well. But…
Ray Lei
  • 1
  • 1
0
votes
1 answer

How does robocode work?

For my University course we have been given the code for the programming game robocode and we need to add features to the game to change how it is played. To do this I need to know more about how robocode works. So what code runs first and what it…
Yep_It's_Me
  • 4,494
  • 4
  • 43
  • 66
-1
votes
2 answers

Can you explain what this code from robocode means?

I do not understand what this method exactly is doing. Could someone explain this trig to me? public void onScannedRobot(ScannedRobotEvent e) { setTurnRadarLeftRadians(getRadarTurnRemaining()); setTurnRight(e.getBearing() + 90.0D - dir /…
-1
votes
1 answer

Robocode: Where can I get a JAR file for the Engine?

I wish to automatically run a series of Robocode tanks in matches, and recieve back their scores and other info. I believe that I require the Robocode Engine, and wondered where I could get a JAR file for using it in Java. Thanks!
user1966361
  • 179
  • 1
  • 3
  • 14
-3
votes
1 answer

How do I add wall avoidance to my robocode code?

I am programming a robot that runs in Robocode. My code currently works, and my tank runs just like I want it to run and move. The only problem is that it runs into the wall several times a battle and I lose health every time that occurs. I have…
Stephen3107
  • 13
  • 1
  • 3
-3
votes
1 answer

How to Override A Method in Java

I play Robocode (it is a java programming game). I want to change the method public void onScannedRobot (ScannedRobotEvent e) { } to public int onScannedRobot(ScannedRobotEvent e){ } So I can adapt my robot more if it scanned is true or…
1 2 3 4
5