Skip to content

Java board game developed using MVC architecture with both Swing GUI and console versions.

Notifications You must be signed in to change notification settings

evelin1031/numeri-java-board-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Numeri – Java Board Game (MVC & Swing)

Numeri is a strategic board game developed in Java as part of an Object-Oriented Programming school project.

The goal of this project was to design a complete game while applying clean software architecture principles, including MVC separation, object-oriented design, and an interactive graphical interface using Swing, while keeping a text-based version for debugging and validation.


Game Overview

  • Turn-based board game
  • Two players by default (easily extensible)
  • Each player owns six pieces numbered from 1 to 6
  • At each turn:
    1. The player rolls a dice
    2. Selects one or more pieces whose sum matches the dice value
    3. Chooses the order in which the pieces are moved
    4. Pieces move to the next available free cell, skipping occupied ones
  • The game ends when the last three cells of the board are occupied
  • The final score depends on the value of the cells and the coefficient of the piece placed on them

Key Features

Gameplay

  • Automatic detection of valid piece combinations after each dice roll
  • Piece selection validation (only allowed when the sum is correct)
  • Dynamic display of the chosen movement order
  • Intelligent movement system with occupied-cell skipping
  • Automatic end-of-game detection
  • Final score calculation and display

Two Play Modes

  • Text-based version (console)
  • Graphical version (Java Swing)

Design & Robustness

  • Clear separation between model and view
  • MVC architecture (not 100%)
  • Defensive programming to prevent runtime errors
  • Code designed to be maintainable and extensible

Software Architecture

The project follows a classic MVC (Model–View–Controller) architecture.

Model

  • Piece
  • Player
  • Cell
  • Board
  • Die
  • Score

View

  • NumeriView
  • Rendering of the board, cells, and pieces
  • Interactive graphical interface

Controller

  • NumeriController
  • Game rules and turn logic
  • Event handling
  • Synchronization between model and view

Technologies Used

  • Java
  • Swing / AWT
  • Object-Oriented Programming (OOP)
  • MVC Architecture
  • Event-driven programming

Running the Project

Text-based Version

cd "Code texte"
javac Main.java
java Main

The program will prompt you for player names and guide you through the game.


Graphical Version (Swing)

cd "Code graphique"
javac MainControl.java
java MainControl

Default configuration:

  • Two players: J1 and J2
  • Player names can be modified in MainControl.java

How to play:

  1. Click Roll the dice
  2. Select the piece(s)
  3. Validate your move

Planned Extensions

  • Restart game button
  • Special cells (bonus, penalty, extra turn, backward movement…)
  • Three-piece alignment effects
  • AI-controlled player
  • Score persistence
  • Alternative board layouts (spiral, branching paths…)

Authors

Eve Lin

  • Game logic and model design
  • MVC architecture
  • Text-based and graphical versions
  • Core gameplay implementation and debugging

Doha Bentaoussy

  • Graphical user interface development
  • UI testing and validation
  • Gameplay integration

License & Context

This project is shared for educational and portfolio purposes. It demonstrates skills in Java development, object-oriented design, software architecture, and GUI programming.

© 2024–2025 – Eve Lin & Doha Bentaoussy

About

Java board game developed using MVC architecture with both Swing GUI and console versions.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages