Virtual Pet Simulator

Java  //  Software Design  //  Design Patterns  //  UML

01. Overview

Developed a robust virtual pet simulation game in Java, focusing on the rigorous application of Object-Oriented Programming principles and industry-standard design patterns. The project involved creating an interactive environment where a digital pet reacts to user actions such as feeding, sleeping, and playing.

The primary goal was to architect a system that is both scalable and maintainable, utilizing comprehensive UML modeling to guide the implementation of complex game logic and state transitions.

02. Engineering & Design Patterns

The architecture leverages specific design patterns to solve common software engineering challenges, ensuring clear separation of concerns and structural integrity.

  • Singleton Pattern: Implemented global access points for core game entities like the Pet and the User, ensuring a consistent state throughout the entire application lifecycle.
  • Factory Method: Utilized a UIFactory to handle the dynamic instantiation of various user interface modules (MainUI, ShopUI, MiniGameUI), allowing the system to switch contexts without tight coupling.
  • Inheritance & Polymorphism: Developed a BaseUI hierarchy to standardize interface behavior while enabling specialized logic for different game activities through method overriding.
  • State Machine Architecture: Built a detailed state machine to manage the pet's physiological conditions across distinct states including IDLE, SLEEP, ANGRY, and DEAD.

03. Subsystems & Logic

The project includes a fully integrated inventory and shop system, where users can manage resources to maintain their pet's health. I also engineered a mini-game module to provide dynamic engagement, which feeds data back into the pet's happiness metrics.

By implementing persistent game state saving, the application ensures that user progress and pet statistics are preserved between sessions. This project demonstrates a high level of technical rigor in translating abstract design requirements into a functional, modular, and well-documented Java codebase.

View Source on GitHub