This is a JavaFX implementation of the Scrabble game using the Model-View-ViewModel (MVVM) architecture and Observer-Observable design pattern. The game operates with Server-Socket and has two modes: Guest and Host mode. This project was developed as part of a college course and demonstrates knowledge of advanced programming concepts, including design patterns, object-oriented programming, and user interface design.
Tal Zigelnik
Or Shimon
Jonathan Cewingel
Tal Lovton
![](https://private-user-images.githubusercontent.com/107995222/241409882-ca366541-eabe-4f1b-9beb-acd700e6afbf.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQwNjA3NTMsIm5iZiI6MTcyNDA2MDQ1MywicGF0aCI6Ii8xMDc5OTUyMjIvMjQxNDA5ODgyLWNhMzY2NTQxLWVhYmUtNGYxYi05YmViLWFjZDcwMGU2YWZiZi5qcGc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwODE5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgxOVQwOTQwNTNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0zMmVlNmYyMjgxMDkzYTcwNDViZDQ1YjM3ZDA0YzEyNzZmM2Y3NDMxNDliYmQ2YTI4Y2M0NjZhMjExNDdkNTU2JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.9UOQTZ0IWG6NXdKCIHsUwV9ZerpyURMXqtS2bPC7sD4)
![](https://private-user-images.githubusercontent.com/107995222/241409884-7a2a4c10-74b9-42f4-b714-7dd72b0a7d1d.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.ey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LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.yVQe9hlYXJK1pxy0nEdSsRTzdRkOoA9PfZ5KjVq82m8)
Host Mode
In Host mode, the player starts a new game and waits for other players to join. Start the application and select the Host mode. Enter a username and a port number. Click on the "Start Game" button to start the game. Wait for other players to connect to your server.
Guest Mode
In Guest mode, the player joins an existing game hosted by another player. Start the application and select the Guest mode. Enter a username, a server IP address, and a port number. Click on the "Join Game" button to join the game.
Once the game has started and the players have joined, the game board will be displayed at the center of the window. Each player will have a row of tiles at the bottom of the window representing their hand. To make a move, the player can select a tile from their hand and drag it on an empty cell on the board. The game ends when a player has used all of their tiles or when there are no more valid moves left on the board. The player with the highest score at the end of the game wins.
- Clone this repository: git clone https://github.com/zigelnik/Scrabble.git
The project is structured using the MVVM architecture and Observer-Observable design pattern. The purpose of this architecture is to separate the user interface from the underlying data model, making the code easier to read, maintain, and extend. The project is divided into three main packages:
Model: Contains the server and client communication methods, data model classes for the game, including the Scrabble board, tiles, and players. The classes in this package are responsible for the game's logic and state.
View: Contains the JavaFX view classes for the game, including the game board, player tiles, and game windows. The classes in this package are responsible for displaying the game's user interface and handling user input like name and ip/port.
ViewModel: Contains the view model classes for the game, which handle the game logic and communication between the model and view. The classes in this package act as intermediaries between the model and view, responding to user input, binding it to model's varbiable and updating the view accordingly.