Prev |
30. exercise: Robocode game
Clone project:
cd ~/git
git clone ssh://student@cserver/home/git/robocode
cd robocode- In Eclipse select File— Import...— Existing project into workspace select root directory of the and select robocode project
- To run game, select Run— Run as...— Java application and select Robocode - robocode
- In the game select Robot— Editor then File— New— Robot and enter robot name in form: Name_Surname
- Enter package name jtm
- Use standard generated code and change it (to allow saving) and save it
- Implement jtm.Name_Surname.java class:
- you can reuse existing code and extend Robot class,
- you cannot implement other interfaces, and algorithms with persistence are not allowed,
- you will need to describe how tank works.
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- Update project and run game with all robots from jtm package
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
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- If you cannot push changes to server:
- checkout file version from the server with git checkout conflicting_file
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 |