Short Manual
Please refer to the user manual for more detailed and additional information. Information for developers can be found at the end of this file.
System Requirements
Java 8 must be installed. On Ubuntu-based system with an older version of Java (check java -version
), execute the following commands:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
Run the Game
In order to help us with finding bugs, you should create a log file when running the game by starting it using this command (we’ll add an automatic logging feature in the future):
java -jar Charly_in_Madagascar.jar 2>&1 | tee `date +%H%M%S`.log
If you happen not to use a Linux-based system, use the ordinary
java -jar Charly_in_Madagascar.jar
command (or double-click if it works for you). Please make sure that the execution directory is the one containing the .jar file.
How to play a local game
- Click on “Start local game”.
- Choose the teams and a game style. (These can be changed using the “Customize” option in the main menu.)
- Click on “Continue”.
- The active team is shown in the top left corner. Use the left/right/up (or A/D/W) keys to move the active figure.
- Press a number to select a weapon. Press up/down/left/right (or W/S/A/D) to move the cross hair.
- Press space to shoot.
- When only one team is left, a game over window is shown.
How to play a network game
Start Server
- Click on “Start network game”.
- Enter your name.
- Click on “Host a game”. (NB: If you’re playing over the Internet, make sure that your firewall does not block connections on port 61421. You might need to enable port-forwarding in the settings of your router.)
- Change the game settings.
- Wait for all players being ready.
- Click on “Start”.
- The game can be paused by pressing P, ESC, or F1.
Connect as Spectator
- Click on “Start network game”.
- Enter your name and the ip address of the host.
- Click on “Join a game”.
- Depending on the game status, you see the lobby (and you have to wait till the host starts the game) or the running game.
Connect as Player
- Follow the steps of “Connect as Spectator”
- Uncheck “Spectator”.
- If the maximum number of teams is not reached, you can now choose your team profile.
- Click on “Ready” to inform the server of the changes you made.
- Wait for the host to start the game.
How to set up a connection with a computer being connected using a patch cable (aka How to get an ip with a LAN connection)
NB: Modern hardware does not require to use a crossover cable.
- Open the tool of your operating system for creating new network connections (connection editor or the like).
- Create a new cable connection.
- Set “cloned mac address” to the hardware address of your network card (eg. see
ifconfig
, section ethX
).
- Set “IPv4 Method” to “Manual”.
- Add address “10.0.0.x” (x must be unique for each player), network mask “255.255.255.0”.
- Give the connection a sensible name, eg. “Afrobob”.
- Connect.
Information for Developers
Import into IDE
IntelliJ
You can download the free community edition of IntelliJ from jetbrains.com/idea.
Import Project
- Click on “File” → “Import Project…”
- Choose the folder which contains the
src
directory. Click on “OK”.
- Choose “Create project from existing sources,” and click on “Next”.
- Leave the default project location, and click on “Next”.
- Make sure that
src
is detected as java source directory, and click on “Next”.
- Add the
lib
directory as external library, and click on “Next”.
- No dependencies are needed, click on “Next”.
- Choose SDK version 1.8 (JDK home path might be something like
/usr/lib/jvm/java-8-oracle
). Click on “Finish”.
Change Project Settings
- Click on “File” → “Project Structure…”.
- Under “Project,” set language level to 8.0.
- Click on “OK”.
Create Run Configuration
- Click on “Run” → “Edit Configurations”.
- Click on “Add New Configuration” → “Application”.
- Set main class to
afrobob
.
- Click on “OK”.
Create .jar Build Configuration
- Click on “File” → “Project Structure…”.
- Under “Artifacts”, click on “Add” → “Jar” → “From modules with dependencies”.
- Choose “Afrobob” as “Main Class”.
- In both dialogs, click on “OK”.
- Click on “Build” → “Build artifacts…” → “Build”.
- Copy (or link) the
resources
directory to out/artifacts/*_jar/
.
other IDEs
Please refer to the manual of your IDE. If you can provide step-by-step instructions for your favourite IDE, we are willing to add them here.
Generating JavaDoc
CLI
cd
to the src
directory.
- Execute
javadoc -d ../doc -subpackages de -private -exclude de.hhu.propra.team61.io.json
.
IntelliJ
- Click on “Tools” → “Generate JavaDoc…”.
- (optional, to suppress some errors) Choose “Custom Scope”.
- (optional) Include “Production Classes” recursively.
- (optional) Exclude “de.hhu.propra.team61.io.json” recursively. (The JavaDoc of this library is not well-formed.)
- Choose a sensible output directory.
- You might want to chose output level “private” and check “Open generated documentation in browser”.
- Click on “OK”.