Build&Cross is a rogue like game where the player needs to build passage through natural obstacles for a constantly moving train. The player needs to travel around the map to find the correct materials (e.g. wood, iron) to construct the passages. After traversing one obstacle, the train will move to a different environment with a different obstacle, and to win, the player needs to get the train to the end of the map. If the train reaches the obstacle before the passage is built, the game is lost.
This project is both a Maven project and a BlueJ project.
You can open, compile, test, and run the code within BlueJ
by opening src/package.bluej
.
You can use Maven to compile, test, and check the code
by running mvn
in this top-level directory (see below).
You can run the code compiled by Maven from the terminal (see below).
The code is structured into three packages:
model
- all the model classes and their teststui
- text user interface (works in a terminal)gui
- Swing-based graphical user interface (opens a window)
Note that the classes in the model
package MUST NOT refer to any
classes in the tui
or gui
packages.
The classes in the tui
package must not refer to any classes in the gui
package.
The classes in the gui
package must not refer to any classes in the tui
package.
The classes in the tui
and gui
packages SHOULD refer to classes in the model
package.
The classes in the model
package need to come with unit tests.
(The classes in the tui
and gui
packages do not need to be covered with tests.)
In this top-level directory:
mvn compile
To run the application from outside BlueJ, first build it with Maven.
This generates the compiled classes in the directory target/classes
.
To run this application, with the TUI, from the command line:
java -cp target/classes tui.Main
Key screenshots for tui:
This is the initial state of the game, the user is able to study the grid before they spawn the player.
After the player is spawned, the user has in front of them the list of all possible actions to remind them of how to play.
To run this application, with the GUI, from the command line:
java -cp target/classes gui.Main
DESCRIPTION OF COMMAND LINE ARGUMENTS
mvn test
mvn compile
mvn checkstyle:check
mvn compile
mvn pmd:check
mvn compile
mvn pmd:cpd-check
mvn site
Then open target/site/index.html
and find the JaCoCo report.