MrTimmyJ

Main Project Image

Text Based RPG

January 2021 - February 2021

A text based role playing game where you explore rooms and collect items to survive.

< >

Project Overview

        Explore a mysterious house room by room, collect items, interact with your environment, and navigate through a branching world—all through your command line.


        This is a text-based role-playing game (RPG) built in Java that allows players to explore a series of interconnected rooms in a house. Each room contains items that can be picked up or dropped, and rooms may have unique mechanics (such as healing). Players can navigate using typed commands and manage an inventory system.

Project Detail Image

Player Initialization: The game creates a player with a name, starting room, and an empty or pre-defined inventory.

Room Interaction: Each room contains:

  • A unique name
  • Items to interact with
  • List of directional exits

Project Features

  • 🧍 Player creation and inventory system
  • 🧭 Room navigation with cardinal directions (north, south, east, west)
  • 🪑 Dynamic room objects and interactions
  • 🛏️ Special rooms (e.g., Sleep Room that heals the player)
  • 🛠️ Command-based interaction system (like look, inventory, pick up)
  • 📦 Utility class for modular string-based item management
Project Detail Image

Gameplay

You begin by entering a room and are prompted with command options. Each action affects the state of the game.

Project Detail Image
  • look....................................List all visible items in the room
  • inventory..........Check what items you're currently carrying
  • go (dir)............Move to a new room (where dir is n/e/s/w)
  • pick up.................................Pick up an item from the room
  • drop..........Drop an item from your inventory into the room
  • exits...........Show all available exits from the current room
  • help.................................Show help menu with commands
  • quit...................................................................Exit the game

Technologies Used

  • Java 15
  • Command Line Interface (CLI)
  • OOP Principles (Encapsulation and Inheritance via CustomPlayer)
  • Tokenizer and StringBuilder for parsing and managing state