Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🏠 CLI-based Monopoly with Save/Load System

A command-line Monopoly game built in Java featuring property trading, rent, dice rolls, and a full save/load system.

A fully functional text-based Monopoly game written in Java, built from the ground up to simulate the core mechanics of Monopoly — property ownership, rent collection, dice rolling, and player balance management — all through the command line.

This project also introduces data persistence through a custom save/load system, allowing players to pick up their game right where they left off. It showcases practical use of object-oriented programming, file I/O, and error handling in a console environment.


🧠 Overview

This project replicates the main gameplay loop of Monopoly, including player turns, property ownership, chance/luck through dice rolls, and financial management. It was developed as part of a class project focused on object-oriented design and Java file handling.

The game operates fully through a command-line interface, emphasizing logic structure and clarity over graphics — an intentional design choice to focus on gameplay logic and program structure.


⚙️ Features

  • 🎲 Roll Dice – Random dice rolls determine player movement across the board
  • 🏡 Property System – Buy, sell, and pay rent for properties you land on
  • 💰 Money Tracking – Balance updates after every transaction or rent payment
  • 🚔 Go & Jail Mechanics – Implements Monopoly’s corner rules for realism
  • 💾 Save and Load System – Game states are saved and restored using Java file I/O
  • ⚠️ Error Handling – Prevents invalid inputs and ensures game stability

💡 Key Concepts Demonstrated

  • Object-Oriented Programming (OOP)
  • Java Collections & Data Structures
  • File I/O (Reading and Writing Game Data)
  • Input Validation & Exception Handling
  • Encapsulation of Game Logic

🖼️ Game in Action!

🎮 Gameplay

game1 game2

💾 Saving Game

save

📂 Loading Game

load

⚠️ Error Handling

error1 error2
error3

🛠️ Technologies Used

  • Language: Java
  • Environment: IntelliJ IDEA / VS Code
  • Libraries Used: Java I/O, Collections, Random
  • Concepts Covered: OOP, file persistence, control flow, validation

📚 Learning Takeaways

This project strengthened my understanding of object-oriented programming, especially how multiple classes can interact to represent a complex system like Monopoly. Implementing a save/load system helped me learn practical file I/O handling and serialization concepts, while designing the turn-based loop taught me how to structure a clean, reusable game flow.


🚀 How to Run

1. Clone this repository:

git clone https://github.com/moussakabalan/java-monopoly-cli.git  

2. Open the project in your IDE of choice.

3. Compile and run the main game file:

javac MonopolyGame.java  
java MonopolyGame

Original Project Dated 09/25/25

About

Command-line Monopoly game built in Java featuring property trading, rent, dice rolls, and a full save/load system.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages