Wordspire is a mix between Connect-4 and Scrabble that plays on a 7x7 board with a 7-letter rack. Each turn a player chooses a tile from the rack and places it in one of the columns on the board, forming words and getting points for each new word. Wordspire has 3 game modes: singleplayer, local multiplayer, and vs. Bot. Inspired by simple word games, such as Wordle, we aimed to develop a new word game that is easy to learn and fun to play.
Wordspire is comprised of 2 main components, the frontend which accepts player inputs and the backend which handles the game logic and contains the bot.
To communicate between components, the backend is a Python class, which can be initialized with certain game rules and in a specific game mode. These features are then easily accessed by the front end through a variety of functions such as place_piece, get_best_move, etc. The backend class also hosts the bot, which uses Cython for a performance speed up over Python and is similarly implemented as a class with accessor functions.
The frontend is implemented in Python through the pygame library, which is used to handle graphics and user interaction. Using game assets including image tiles, sound effects, and a leaderboard file the frontend also creates an interactive game board, which players can play with via mouse clicks and keyboard actions, also handled by the frontend. Finally, the frontend holds an instance of the backend class and calls functions on the backend to implement core functionalities as discussed below.
The back end is designed to support the implementation of our game and its various game modes, including maintaining the current board and rack, calculating scores, tracking player moves, enforcing rules, and providing feedback on played tiles such as definitions and earned points. The words and their definition come from the 2019 Scrabble Collins Dictionary word list. Finally, the backend also implements the bot logic as a separate class, which uses a min-max algorithm with alpha-beta pruning. Due to the randomness of potential newly drawn times, the bot only considers the tiles currently on the rack, leading to a max depth of 7, which can be computed in roughly 1-2 seconds.
- Clone this entire repository somewhere convenient on your machine
- Ensure you have python3 installed, you can install python here: https://www.python.org/downloads/
- Open the WordSpire repository in your terminal
- (Optional) Creating a venv is optional but recommended. To do so run the following two lines which create and activate your virtual environment.
python3 -m venv venv
source ./venv/bin/activate
python3 -m venv venv
venv\Scripts\activate
- Install required packages by running
pip install -r requirements.txt
- To launch the game run front_end.py
python3 Game/Front_end.py
Press 'R' to view the current player's rack
Press 'B' or 'ESC' to view the board from the rack menu
Press 'L' to view the leaderboard for the current gamemode
Press 'P' to pause the game
Press 'W' to view all current words made by each player
Click on tiles when viewing the board to see if any words were generated at said tile
These rules can also be easily visualized at any time in-game by clicking on the blue "i" button.
- Phillip Nakamura: Backend
- Ben Pazner: Backend
- Jasmine Patel: Frontend
- Aidan Tijerina-Albury: Frontend