Jokemon
RepositoryThe Jokemon Project is essentially a simplified copy of the game Pokémon. I received a base project from my teacher. This base project included a foundation for attacks and a foundation for Jokemons. I significantly expanded upon this foundation. This game is entiretly played in the console, if you decide to play it by downloading it from the GitHub repository, please make sure to pick UTF-8 Encoding when choosing your console.
2D Environment
I added a two-dimensional environment. In this environment, players can move around freely, but there are several obstacles such as trees or rivers which must be navigated around. There are several different regions in the environment and other objects with which the player can interact.
Interactable Objects
There are enemy NPCs, wild Jokemons, and buildings. Enemy NPCs can be challenged to a battle. In these battles, players fight against the NPC's Jokemons, and if they win, their own Jokemons level up. Wild Jokemons are scattered across the environment and can be captured and added to the player's team. There are three types of buildings: the Medical Center, where players can revive their Jokemons after battles; the Shop, where players can buy treats for their Jokemons; and standard buildings, which can be entered but do not contain much functionality.
Map Selection
At the beginning of the game, players can choose from five different maps. These maps are then automatically loaded. The first three maps are 25 by 25 tiles in size and are highly detailed. The last two maps are larger, with 50 by 50 tiles. On all maps, players can move freely and interact with objects.
Jokemon Evolution
As the game progresses, players level up their Jokemons by battling. When a Jokemon reaches a high enough level, it can evolve, just like in the original Pokémon games. Evolving a Jokemon grants it new attacks and generally makes it stronger and more durable.
Saving Game Progress
I developed a system that allows players to save their game progress. This save system enables players to load their game after restarting the application and selecting the same map, allowing them to continue right where they left off.
GameState Class
Here is a snippet from my GameState class. This class stores the current game state and creates an object that is then processed by my SaveSystem to either save or load the game state:
1public class GameState implements Serializable {
2 private int seed;
3 private int playerLevel;
4 private int playerCoins;
5 private int playerTreats;
6 private int[] playerPosition;
7 private int playerDirection;
8
9 private List<JokemonData> playerJokemons;
10 private List<JokemonData> jokemons;
11 private List<WildJokemonData> wildJokemons;
12
13 public GameState(int seed, int playerLevel, int playerCoins, int playerTreats, int[] playerPosition,
14 int playerDirection, List<JokemonData> jokemons, List<WildJokemonData> wildJokemons) {
15
16 this.seed = seed;
17 this.playerLevel = playerLevel;
18 this.playerCoins = playerCoins;
19 this.playerTreats = playerTreats;
20 this.playerPosition = playerPosition;
21 this.playerDirection = playerDirection;
22 this.jokemons = jokemons;
23 this.wildJokemons = wildJokemons;
24 }Building Class
The Building class is an abstract class. It allows me to centralize the basic logic of a building while creating more specialized subclasses for the different building types through class inheritance.
1public abstract class Building {
2 // Enum for different building types
3 public enum BuildingType {
4 MEDICAL,
5 SHOP,
6 HOUSE,
7 OUTSIDE
8 }
9
10 // Common properties
11 protected int centerX;
12 protected int centerY;
13 protected BuildingType buildingType;
14 protected boolean canEnter;
15 protected char[][] design;
16
17 // Constructor for the abstract class
18 public Building(int centerX, int centerY, BuildingType buildingType, boolean canEnter, char[][] design) {
19 this.centerX = centerX;
20 this.centerY = centerY;
21 this.buildingType = buildingType;
22 this.canEnter = canEnter;
23 this.design = design;
24 }
25
26 // Getter for the Design of the abstract class
27 public char[][] getBuildingDesign() {
28 return design;
29 }50 x 50 2D Map
Here I've included a screenshot from Map 4. Using ANSI codes and Unicode characters, I was able to design a visually appealing map. In the center, you can see the player, marked by a pink arrow. The map features enemies (Red N), wild Jokemons (Turquoise J), rivers and lakes (Blue Rectangle), impassable trees (Green T), bridges (Pink Rectangle), and various distinguishable buildings identified by the letter in the middle.
