Skip to content

CS222-UIUC/WordSpire

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wordspire: A mix between Connect-4 and Scrabble

Overview:

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.

Screenshot 2024-12-12 at 12 45 31 PM Screenshot 2024-12-12 at 12 42 03 PM

Technical Architecture:

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.

Technical Architecture Diagram

Frontend:

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.

Backend:

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.

How to Play Wordspire:

To install and run Wordspire:

  1. Clone this entire repository somewhere convenient on your machine
  2. Ensure you have python3 installed, you can install python here: https://www.python.org/downloads/
  3. Open the WordSpire repository in your terminal
  4. (Optional) Creating a venv is optional but recommended. To do so run the following two lines which create and activate your virtual environment.
Mac/Linux:
python3 -m venv venv
source ./venv/bin/activate
Windows:
python3 -m venv venv
venv\Scripts\activate
  1. Install required packages by running
pip install -r requirements.txt
  1. To launch the game run front_end.py
python3 Game/Front_end.py

Basic controls:

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.

Screenshot 2024-12-12 at 12 50 47 PM

Authors/Contributors:

  • Phillip Nakamura: Backend
  • Ben Pazner: Backend
  • Jasmine Patel: Frontend
  • Aidan Tijerina-Albury: Frontend

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •