Skip to content

martinjonsson01/pawntastic

Repository files navigation

Pawntastic

An object-oriented game written in Java using libGDX.

Test Suite

Understanding the Architecture

There is a UML class diagram of each package located in the README file of each package directory. It is visible directly when navigating to the package directory on GitHub, but if viewing the files locally the raw images can be found in documents/diagrams/.

com.thebois package class diagram

Running the Game

Prerequisites

To run the latest version of the game, download the jar file from releases and run it using the command:

java -jar ColonyManagement-vX.X.X.jar

Running From Source

To build the game directly from the source code, you need to have some common development tools installed.

Prerequisites

  • JDK 15
  • Maven installed according to instructions
  • JAVA_HOME environment variable set to point to JDK 15

How to Build and Run From Source

  1. Clone the repository using git clone https://github.com/martinjonsson01/OOPP-WITH-THE-BOIS.git or downloading as ZIP.
  2. Navigate to the root directory: cd OOPP-WITH-THE-BOIS
  3. Run mvn clean test to download runtime dependencies and test dependencies, and to check that the program is running correctly.
  4. Run mvn compile exec:java to start the program.

Common Issues and Solutions

  • You get java.lang.UnsupportedClassVersionError.
    • You're running the program with too old a version of Java. You need Java 15 or later. If you have it installed, then your environment variables are incorrectly configured. Make sure your Path environment variable contains a path to the bin folder of your Java installation. Also make sure that no older versions of Java are in your Path (both user and system variables)
  • mvn not recognized as a command.
    • The bin folder of the Maven installation has not been added to the PATH environment variable.
  • mvn outputs "The JAVA_HOME environment variable is not defined correctly"
    • The environment variable JAVA_HOME in Windows is not set to the path of the installed JDK 15 (should not be the bin folder).
  • Not using the correct JDK version.
    • Double check the version by running java --version. It should be 15.0.2 or later. If it is incorrect, update your JAVA_HOME and/or PATH environment variables.

Analytical tools for the project

To ensure Pawntastic follows good code practices a number of tools have been and is being used in the development of the project. Each subsection will go over the usage of the tool and how to use/run it.

(Maven is suggested for running these tools for the project.)

JDepend

The answer to "What is JDepend?" found on their FAQ page describes the tool perfectly.

JDepend is a tool that traverses Java class file directories and generates design quality metrics for each Java package. JDepend allows you to automatically measure the quality of a design in terms of its extensibility, reusability, and maintainability to manage package dependencies effectively.

Use JDepend on Pawntastic by following these steps:

  1. Run mvn jdepend:generate
  2. Open the HTML file generated by maven located in target/site/jdepend-report.html.

PMD

PMD is a tool that performs a code analysis on the source code and generates a report based on the findings. The tools can analyze for bad practices and can also run a Copy/Paste Detector.

Use the code analysis by following these steps:

  1. Run mvn pmd:pmd
  2. open the HTML file (located here: target/site/pmd.html) to see the report.

Use the CopyPaste Detector by following these steps:

  1. Run mvn pmd:cpd
  2. open the HTML file (located here: target/site/cpd.html) to see the report.

Checkstyle

Checkstyle is a tool used for alerting the developer if any violation of common good practices or code style. (The same plugin can be installed directly into IntelliJ for faster/easier reporting).

A site with the report of any violation can be generated by following these steps:

  1. Run mvn checkstyle:checkstyle
  2. open the HTML file (located here: target/site/checkstyle.html) to see the report.

About

A simple resource-gathering game written in Java using libGDX.

Resources

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •  

Languages