This project is a simple text-based adventure game created for a coding assignment. The goal of the game is to explore different locations, fight enemies, collect items, and ultimately win by clearing all combat areas.
Compile the code:
javac -d ../out/OOPAdventure Main.java
Run the game:
java -cp ../out/OOPAdventure/ Main
- src/Main.java: Entry point of the application.
- src/game/Game.java: Manages the main game loop and initialization.
- src/players/Player.java: Represents the player with attributes like username, character, and inventory.
- src/players/UserInteraction.java: Handles user input and interactions.
- src/characters/: Contains various character classes (e.g., Samurai, Knight, Archer).
- src/items/: Defines item-related classes including weapons, armor, and drops.
- src/locations/: Includes safe and combat location classes.
- src/enemies/: Defines enemy types encountered in combat locations.
- Player: Holds player's information such as username, chosen character, and inventory.
- UserInteraction: Facilitates interaction with the player through console inputs and outputs.
- Game: Initializes the game, manages the game loop, and handles player actions based on menu choices.
- Shop: Allows players to buy items.
- BaseCamp: Restores player's health.
- Cave, Forest, River, Mine: Different combat zones where players can fight enemies and collect loot.
- Weapons: Pistol, Sword, Rifle, etc.
- Armor: Light, Medium, Heavy, etc.
- Drops: Food, Water, Firewood.
- Playable Characters: Samurai, Knight, Archer.
- Enemies: Zombie, Vampire, Bear, Snake.
- Character Selection: Choose your character from available options.
- Exploration: Navigate through different locations using the menu.
- Combat: Engage in battles with enemies in combat locations.
- Shopping: Buy items from the shop to enhance your abilities.
- Winning Condition: Clear all combat locations to win the game.
This project is intended for educational purposes and may not include advanced features or optimizations. Contributions are welcome to improve the code quality and add new features.
Enjoy your adventure!