A desktop Snake and Ladder game built with Java and JavaFX, developed as the final project for the Advanced Programming course.
Mar Va Pele is a classic Snake and Ladder board game, played between the user (YOU) and the computer on a 10×10 board (100 tiles).
Rolling the dice moves your piece forward tile by tile. Landing on the bottom of a ladder sends you climbing up; landing on the head of a snake sends you sliding down. The first player to reach tile 100 wins.
Roll the dice by clicking the on-screen button. Turns alternate automatically between YOU and the COMPUTER, which rolls on its own after a short pause.
Eight snake/ladder connections are drawn directly on the board as colored lines — yellow for snakes (moving down), light yellow for ladders (moving up) — so the board layout is visible before you even roll.
Pieces move step by step across tiles using PauseTransition, rather than jumping instantly to the destination, including the extra jump when landing on a snake or ladder.
The game automatically detects when a player reaches tile 100, displays the result in the title bar, and disables further dice rolls.
| Technology | Purpose |
|---|---|
| Java | Core game logic and state |
| JavaFX | UI rendering, board layout, animations |
Snake-Ladder-Game/
│
├── marVaPeleApplication.java → JavaFX Application entry point, board & game loop
├── marVaPeleController.java → Player state (name, color, position, board piece)
│
├── Dice/
│ ├── Num1.PNG
│ ├── Num2.PNG
│ ├── Num3.PNG
│ ├── Num4.PNG
│ ├── Num5.PNG
│ └── Num6.PNG
│
├── screenshots/
│ └── snake-ladder-game-start.png
│
└── README.md
⚠️ This repository currently contains raw.javasource files with no build configuration (no Maven/Gradle project yet — see Roadmap below). To run it, set it up manually:
- Install a JDK (11+) and download the JavaFX SDK matching your JDK version.
- Open the project folder in an IDE that supports JavaFX (e.g. IntelliJ IDEA).
- Add the JavaFX SDK
libfolder as a library, and set these VM options:--module-path /path/to/javafx-sdk/lib --add-modules javafx.controls,javafx.graphics - Run
marVaPeleApplication.java— it contains themainmethod.
- No build tool (Maven/Gradle) — dependencies and compilation are manual.
- No automated tests.
- Fixed 2-player mode only (YOU vs. COMPUTER).
- Add a
pom.xml(Maven) orbuild.gradlefor one-command builds - Add unit tests for movement and snake/ladder logic
- Support more than 2 players
- Add sound effects for dice rolls and wins
This project is licensed under the MIT License. See LICENSE for details.
Arian Shayestehfard
Final project for the Advanced Programming course