Skip to content

dosstacy/java-patterns-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

100 Commits
 
 
 
 
 
 
 
 

Repository files navigation

NI-ADP MVC Game (JavaFX)

A JavaFX desktop game project that demonstrates the Model-View-Controller architecture together with multiple object-oriented design patterns. The game is implemented as a university-style assignment and uses Java 19, JavaFX, and Gradle.

This project is an Angry Birds-style game, featuring projectile shooting, enemy structures, and physics-inspired collision behavior.

Overview

This project launches a simple game application using a JavaFX-based UI. The game logic is organized using MVC principles, and the source code is structured into clear architecture modules for configuration, model, view, controller, and game services such as collision, events, and persistence.

Key Features

  • JavaFX-based game launcher and UI
  • MVC architecture with separate model, view, and controller layers
  • Level loading from JSON scene scripts
  • Player controls, shooting, enemy behavior, and collision handling
  • Undo support with the Memento pattern
  • Proxy-based model access and lazy update management
  • Support for multiple design patterns throughout the application

Design Patterns Used

The project demonstrates a number of classic object-oriented design patterns, including:

  • MVC (Model-View-Controller)
  • Abstract Factory
  • Bridge
  • Command
  • Decorator
  • Observer
  • Proxy
  • State
  • Strategy
  • Visitor
  • Memento

Project Structure

  • src/main/java - main application code
  • src/main/resources - game assets, fonts, icons, images, and scene scripts
  • src/test/java - unit tests
  • build.gradle - Gradle build configuration

Requirements

  • Java 19
  • JavaFX 21
  • Gradle wrapper included in the repository

Build and Run

From the project root, open a terminal in the niadp-mvcgame-b241-java folder and use the Gradle wrapper:

./gradlew build
./gradlew run

On Windows, use:

./gradlew.bat build
./gradlew.bat run

The application starts from cz.cvut.fit.niadp.MvcGameJavaFxLauncher.

Testing

Run unit tests with:

./gradlew test

Notes

  • The game loads level definitions from JSON files in src/main/resources/sceneScripts
  • JavaFX support is configured via the org.openjfx.javafxplugin
  • The project includes sample dependencies for JUnit, Mockito, JMockit, and Jackson

Gallery

About

11 Java design patterns in a single game! (uni project) 🐦

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages