A soccer game built with JavaFX and a combination of client-server & p2p networking.
Players compete in fast-paced matches where they control disc-shaped pieces to shoot a ball into the opponent's goal.
![]() |
![]() |
![]() |
┌─────────────┐ ┌─────────────┐
│ Client 1 │ │ Client 2 │
│ │ │ │
│ JavaFX UI │ │ JavaFX UI │
│ Game Engine │ │ Game Engine │
│ P2P (UDP) │ │ P2P (UDP) │
└──────┬──────┘ └──────┬──────┘
│ │
│ TCP (Signaling) │
└───────────┬───────────┘
│
┌──────▼──────┐
│ Server │
│ │
│ Auth │
│ Matchmaking │
│ SQLite DB │
└─────────────┘
soccer-stars/
├── src/main/
│ ├── java/ir/amirilf/soccerstars/
│ │ ├── client/ # Client-side code
│ │ │ ├── controller/ # JavaFX controllers
│ │ │ ├── game/ # Game engine & physics
│ │ │ ├── network/ # Network managers
│ │ │ └── exceptions/ # Client exceptions
│ │ ├── server/ # Server-side code
│ │ │ ├── network/ # Connection & session handling
│ │ │ ├── db/ # Database layer
│ │ │ ├── model/ # Data models
│ │ │ └── exceptions/ # Server exceptions
│ │ └── common/ # Shared code
│ │ ├── dto/ # Data transfer objects
│ │ ├── Config.java # Configuration constants
│ │ └── Protocol.java # Protocol definitions
│ └── resources/
│ ├── fxml/client/ # UI layouts
│ └── logback.xml # Logging config
├── pom.xml # Maven configuration
├── run.sh # Launch script
└── soccer-stars.db # SQLite database
- Java 21 or higher
- Maven 3.6+
rm soccer-stars.db
./mvnw clean compile
./mvnw exec:java -Dexec.mainClass="ir.amirilf.soccerstars.Main" -Dexec.args="server"
./mvnw exec:java -Dexec.mainClass="ir.amirilf.soccerstars.Main" -Dexec.args="client"rm soccer-stars.db
./run.sh com
./run.sh server
./run.sh client

