The goal of this game is to create a kingdom and farmland which are two types of territory.
You then populate them with various villagers which are knights, farmers & blacksmiths.
You have to put your villagers in relevant buildings so farmers go in silos, stables and barns, blacksmiths in forges and blacksmith schools while knights get placed in forts.
At the end a report is generated of what you have created in your kingdom and farmland.
The main purpose is to demo in the code object-oriented programming in Java and use common Java types, methods & control flow statements.
To find the JavaDoc as well as documents related to the project creation please go to the folder - "Notes & Ideas".
- Code was written in Java using IntelliJ IDEA 2024.2.3 (Community Edition)
- openjdk 21.0.4 2024-07-16 LTS
- OpenJDK Runtime Environment Temurin-21.0.4+7 (build 21.0.4+7-LTS)
- OpenJDK 64-Bit Server VM Temurin-21.0.4+7 (build 21.0.4+7-LTS, mixed mode, sharing)
Unit testing is being carried out via junit-jupiter-5.8.1
Obtain the code from https://github.com/markpackham/Java_Game_WithYouWithMe
The best way to edit or run the code is to install IntelliJ IDEA. https://www.jetbrains.com/idea/
The code's original repo was https://github.com/markpackham/Java_WithYouWithMe before it was separated into its own project and moved into the repo https://github.com/markpackham/Java_Game_WithYouWithMe
-
Run the Java based game, the entry point is the class "Main" found in "Java_Game_WithYouWithMe" in production and "src" in development / preproduction.
-
Create a territory of type kingdom (or skip if you just want to make farmland)
-
Create a set number of knights (0-10).
-
Assign the knights to forts that you created, when it comes to a knight you must select a weapon.
-
Create a set of blacksmiths (0-10).
-
Assign the blacksmiths to forges and blacksmith schools.
-
A report of the kingdom is generated.
-
Create a territory of type farmland (or skip if you don't want to make farmland).
-
Create a set of farmers (0-10).
-
Assign the farmers to barns, silos & stables (you can skip these).
-
A report of the farmland is generated.
- All buildings have a name, a year built, numbers of windows, doors alongside 1 unique attribute.
- Often the unique attribute is selected from a list of attributes at random.
- Eg a random number is chosen or the current day of the week or number if the month impacts the result.
- So if you have a farm stable created on a Monday it will have 5 horses while if you made it on Sunday it will have 11.
- You can type 'exit', 'quit' or 'q' at the end of the process to exit the program.
-
Need to implement more Unit tests, so far only done blacksmith, blacksmith school & forge ones since they don't require an Enum with user input for blacksmith creation.
-
A greater focus on gameplay and resource management elements:
- Inflict random famines or enemy attacks that need be mitigated by farmer & knight numbers.
- Allow for population growth as long as there are enough farmers, blacksmiths & buildings to support it.