Hitster is a personal project designed to showcase the fundamentals of Python programming and Spotify API integration. This project demonstrates the creation of a music-based game where players guess the correct timeline of songs, featuring two versions: a Command-Line Interface (CLI) and a Graphical User Interface (GUI).
- Spotify Integration: Fetches song data and plays tracks directly from Spotify.
- Two Game Modes: Play using a CLI or an interactive GUI.
- Dynamic Gameplay: Randomized song selection ensures unique experiences every time.
- Multiplayer Support: Allows multiple players to compete in guessing the correct song timeline.
- Customizable Settings: Easily adjust the number of songs required to win.
- Personal Playlist Support: Allows you to easily add your own Spotify playlists to customize the game experience.
Hitster/
├── CLI_game.py # Command-line version of the game
├── GUI_game.py # Graphical version of the game
├── GUI_CSS.py # Styling for the GUI
├── game_functions.py # Core game logic and functions
├── song_player.py # Handles Spotify playback
├── song_randomizer.py # Randomizes song selection
├── database_updater.py # Updates the song database using Spotify API
├── internet_test.py # Tests internet connectivity and Spotify API
├── spotify_credentials.py # Spotify API credentials and settings
├── MusicFiles/ # Contains song data files
│ └── dane.txt
├── screenshots/ # Screenshots of the game
├── README.md # Project documentation
├── LICENSE # License file
└── .gitignore # Git ignore file
- Python: Core programming language for the project.
- Spotipy: Python library for Spotify Web API integration.
- Tkinter: For creating the graphical user interface.
- Spotify API: For fetching song data and playback.
- Random: For randomizing song selection.
-
CLI Mode:
- Players take turns guessing the correct position of songs in their timeline.
- Songs are played directly from Spotify.
-
GUI Mode:
- Interactive interface with buttons and labels for a seamless experience.
- Dynamic song playback and timeline updates.
-
Database Management:
- Fetches and updates song data from Spotify playlists.
- Stores song information in text files for offline use.
-
Multiplayer Gameplay:
- Supports multiple players with individual timelines.
- Tracks progress and determines the winner.
- Clone the repository:
git clone https://github.com/PyRealm/Hitster
- Install the required Python libraries:
pip install spotipy
- Open Spotify App
- Add your Spotify API credentials in spotify_credentials.py.
- Run the game:
python GUI_game.py
- To test if everything is working run:
python internet_test.py
- To update the database for the playlist of your choice:
7.1. Change playlist_id in spotify_credentials.py.
7.2. Run file:
python database_updater.py
- To run the game in Command Line Version run:
python CLI_game.py
- To change the number of songs needed to win go to spotify_credentials.py and change "number_of_songs_to_win" variable.
- To change file from which the songs are played go to spotify_credentials.py and change "writing_path" variable.
Contributions are welcome! If you have suggestions or improvements, feel free to fork the repository and submit a pull request.
This project is under the MIT License - see the LICENSE file for details.








