Prev
Extra Exercises

30. exercise: Robocode game

  1. Clone project:

    cd ~/git
    git clone ssh://student@cserver/home/git/robocode
    cd robocode
  2. In Eclipse select File— Import...— Existing project into workspace select root directory of the and select robocode project
  3. To run game, select Run— Run as...— Java application and select Robocode - robocode
    1. In the game select Robot— Editor then File— New— Robot  and enter robot name in form: Name_Surname
    2. Enter package name jtm
    3. Use standard generated code and change it  (to allow saving) and save it
  4. Implement jtm.Name_Surname.java class:
    1. you can reuse existing code and extend Robot class,
    2. you cannot implement other interfaces, and algorithms with persistence are not allowed,
    3. you will need to describe how tank works.
  5. Commit and push to server .../robots/jtm/Name_Surname.java file:

    git pull
    git add robots/jtm/Name_Surname.java
    git commit -m "Name Surname"
    git push
  6. Update project and run game with all robots from jtm package

To know progress of competitors, regularly update project from and back to the server.

Problem solutions

  • If there are compilation errors, select Project— Clean...
  • If list of proposed robots doesn't show actual robots, remove file ../robocode/robots/robot.database and restart game
  1. If created robot is not shown in list, compile it manually with game compiler, or in command line:

    cd ~/git/robocode
    javac -cp libs/robocode.jar robots/jtm/*.java
  2. If you cannot push changes to server:
    1. checkout file version from the server with git checkout conflicting_file
    2. use following commands to reset state of the local project:

      git reset --hard HEAD
      git clean -f -d
      git pull
      git push

Additional info

Prev
Extra Exercises

Created by Valdis Vītoliņš on 2017-01-03 08:07
Last modified by Valdis Vītoliņš on 2017-01-02 11:39
 
Xwiki Powered
Creative Commons Attribution 3.0 Unported License