Skip to content

Latest commit

 

History

18 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MythicalBeast

🎮 Overview

MythicalBeast is a lightweight, single‑player RPG built with Java Swing. Players explore a fantasy world, collect monsters, items, and battle through dungeons. The game demonstrates classic OOP principles, a clean Model‑View‑Controller (MVC)‑inspired architecture, and simple persistence via Java object serialization.


✨ Features

  • Rich GUI based on JLayeredPane, CardLayout and GridBagLayout for a responsive, visually appealing interface.
  • Dynamic Home Base with buttons for Monster, Dungeon, Item, Game Data, and Exit.
  • Save / Load system that serializes the entire Player object (including inventory, monsters, and stats).
  • Modular design – separate packages for entity, element, item, gamesettings, and each GUI screen.
  • Extensible – add new monsters, items, or elements by dropping new classes in the corresponding package.

📂 Project Structure

MythicalBeast/
├─ .git/               # Git repository metadata
├─ .gitignore          # Ignored files
├─ .vscode/            # VS Code settings (optional)
├─ README.md           # 📖 This file
├─ bin/                # Compiled classes (generated by build)
├─ client/             # Saved game files (e.g., 1.txt, 2.txt)
├─ resources/
│   └─ images/        # Backgrounds, monster sprites, item icons
└─ src/
    ├─ GUI/           # All Swing UI classes (MainGUI, HomeBaseGUI, …)
    └─ Model/         # Core game logic and data models
        ├─ entity/        # Player, Monster
        ├─ element/       # Elements (Api, Air, Angin, Es, Tanah)
        ├─ item/          # Item hierarchy (PotionHP, …)
        ├─ gamesettings/  # Exception handling utilities
        └─ gamedata/      # GameData (save/load) and Main entry point

🚀 Getting Started

Prerequisites

  • Java Development Kit (JDK) 8 or newer installed and added to PATH.
  • An IDE (IntelliJ IDEA, Eclipse, VS Code) or command‑line tools.

Build & Run (Command Line)

# Clone the repository 
cd d:/Coding/MythicalBeast/MythicalBeast

# Compile all source files
javac -d bin $(find src -name "*.java")

# Run the game
java -cp bin Model.Main

Tip: You can also run the MainGUI directly from your IDE by executing Model.Main.

Running from an IDE

  1. Open the project folder in your favorite IDE.
  2. Mark src as the source root.
  3. Set Model.Main as the run configuration.
  4. Run – the splash screen appears, press any key to continue to the main menu.

🛠️ Architecture Overview

  • Model Layer (src/Model): Holds all game data structures, element definitions, and persistence logic (GameData).
  • View Layer (src/GUI): Pure Swing UI; each screen is a separate class extending JFrame or using JPanel.
  • Controller Logic is embedded in the GUI classes via action listeners that manipulate model objects (e.g., MainGUI creates a new HomeBaseGUI).

The separation keeps UI code independent from business rules, making future refactors (e.g., switching to JavaFX) straightforward.


🤝 Contributing

Feel free to fork the repo and submit pull requests.

  1. Create a feature branch: git checkout -b feature/awesome‑feature.
  2. Follow the existing package structure.
  3. Add unit tests (if you add new logic) under a test/ directory.
  4. Run javac and ensure the game launches without errors.
  5. Submit a PR with a clear description of your changes.

📜 License

This project is licensed under the MIT License – see the LICENSE file for details.

About

Tugas Akhir PBO

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages