This repository is...
🧩 an example for using the javaRCA.de recipe with different Java development tools.
👾 a concise game engine to develop arcade games in Java while learning about Java dependencies and modules.
There are multiple branches in this repository that may interest you. The modules and Java code are the same on all of them. Only the build tool setups differ depending on the choice of dependency notation. There are:
- 🧩
mainThis is my favorite choice: use themodule-info.javafor dependency declaration and Gradle as build tool. (Gradle being the most performant and feature-rich build tool currently available for Java projects.) - 🥯
everythingThis is same asmainbut with the setup for Maven added. The Gradle setup is kept on the branch as the two definitions do not collide. You can use that branch with both build tools and compare. - 👵🏼
no-module-infoThis is old school Java: nomodule-info.javafiles and dependencies are declared directly in the build tools. Both Gradle and Maven setups can be inspected next to each other.
For more details on the structure of this Java project, and Java projects in general, please visit the gradle-project-setup-howto repository.
Compile and run with one command
./gradlew runBuild with Gradle and run with Java
# Compile code, run checks, run tests, assemble artifacts
./gradlew build
# find the install folder
cd apps/app-jamcatch/build/install/app-jamcatch
# Run as Module
java --module-path 'lib' --module de.javarca.engine
# Run on Classpath (old school)
java --class-path 'lib/*' de.javarca.engine.EngineBuild with Maven and run with Java
# Compile code, run checks, run tests, assemble artifacts
./mvnw clean verify
# find the install folder
cd apps/app-jamcatch/target/install/app-jamcatch
# Run as Module
java --module-path 'lib' --module de.javarca.engine
# Run on Classpath (old school)
java --class-path 'lib/*' de.javarca.engine.EngineIf you follow the recipe based on this repository, you may have questions about certain other build configuration topics that are currently out of scope here. Please have a look at the issues and the gradle-project-setup-howto project for further guidance.
Note
️ The game engine is in an early state as it primarily acts as an example here. However, it is fully functional to the point it is and may evolve further.
The javarca-engine offers a number of service endpoints based on the javarca-model.
The example Game – Jamcatch 🫙 – uses this to plug the game implementation into the engine. It is split into three modules:
- jamcatch-stage - the stage setup in which the game takes place
- jamcatch-actors - the game logic
- jamcatch-assets - graphic assets for the game
For convenience, there is an additional project app-jamcatch for composing the game. In the
build.gradle.kts or
pom.xml file of that
project you finde the list of modules that make up the game that is used by Gradle or Maven to fill
the install folder when building.
Some things you can try:
- Remove entries from app-jamcatch/build.gradle.kts or app-jamcatch/pom.xml to dynamically change the composition of the game. For example, you can remove the assets and the game still works without graphics.
- Modify code or assets in one of the three
jamcatch-modules to modify the game. - You can add additional modules to the
gamefolder with your own implementations and assets and replace modules in app-jamcatch. Or add anotherapp-project to theappsfolder. (Note: for Maven you need to register each additional module in the root pom.xml)
Certain aspects of PICO-8 were an inspiration for the game engine.
