Skip to content

Welcome to WarCardGameAI! This project revitalizes the classic "War" card game by integrating advanced artificial intelligence. Players can choose a theme, and the game dynamically generates cards with unique descriptions and images based on that theme.

Notifications You must be signed in to change notification settings

kwasniewskin/WarCardGameAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

WarCardGameAI

Welcome to WarCardGameAI! This project revitalizes the classic "War" card game by integrating advanced artificial intelligence. Players can choose a theme, and the game dynamically generates cards with unique descriptions and images based on that theme. This project showcases skills in Python programming, API integration, GUI development, and version control.

Table of Contents

  1. Features
  2. Screenshots
  3. Installation
  4. Usage
  5. Development
  6. Skills and Learning Outcomes
  7. Deployment
  8. License
  9. Contact

Features

  • AI-Generated Content: Dynamically creates card names, powers, and descriptions based on the selected theme using OpenAI's ChatGPT API.
  • Custom Visuals: LeonardoAI API generates unique images for each card, ensuring alignment with the chosen theme.
  • Intuitive GUI: A modern and user-friendly interface built with the CustomTkinter library.
  • Error Handling: Comprehensive error handling ensures smooth gameplay.
  • Theme Customization: Players can choose any theme he thinks of

Screenshots

Theme Selection Window

Theme Selection

Theme Generation in Progress

Theme Generation

Main Game Window - After Round

Main Game Window

War Bonus Cards

War Bonus Cards

War Result Window

War Result

Example of Generated Cards

Generated Card 1 Generated Card 2 Generated Card 3 Generated Card 4

Installation

System Requirements:

  • Python 3.7 or higher
  • Internet connection for API access

Step-by-Step Installation:

  1. Clone the Repository:
    git clone https://github.com/kwasniewskin/WarCardGameAI.git
  2. Navigate to the Project Directory:
    cd WarCardGameAI
  3. Install Required Dependencies:
    pip install -r requirements.txt
  4. Set Up API Keys:
    • Create ApiKeyOpenAi.txt and ApiKeyLeonardoAi.txt in the WarCardGameAI/war_card_game directory and paste your API keys.

Usage

  1. Launch the Game: Run the main.py script.
  2. Select a Theme: Enter a theme and click "Generate Cards."
  3. Play the Game: Click "Next Round" to reveal the cards and determine the winner.

Development

Tools and Technologies:

  • Python: The core programming language used for the project.
  • CustomTkinter: Used for building the GUI, providing a modern and responsive interface.
  • OpenAI API: Generates text descriptions for the cards.
  • LeonardoAI API: Creates custom card images based on the selected theme.
  • PIL (Pillow): Handles image processing within the application.
  • PyCharm: The Integrated Development Environment (IDE) used for coding, debugging, and testing.
  • Git & GitHub: Version control tools that managed the development workflow, including feature branches, commits, and pull requests.

Skills and Learning Outcomes

  • API Integration: Gained experience in integrating and working with advanced AI-driven APIs, including handling their documentation and limitations.
  • GUI Development: Developed a user-friendly and visually appealing desktop application using CustomTkinter, mastering layout management and user interaction handling.
  • Error Handling: Implemented robust error handling strategies, ensuring a smooth user experience even when encountering unexpected issues.
  • Version Control with Git: Learned and applied best practices for using Git, including merging, resolving conflicts, as well as maintaining a clean and informative commit history.
  • Collaboration with GitHub: Managed the project using GitHub.

Deployment

Deployment Instructions:

  • The game is a desktop application and can be run on any machine with Python installed.
  • Ensure that API keys are stored securely and are not exposed in public repositories.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Contact

For any questions, support, or contributions:

Enjoy your time with the War Card Game! If you have any questions or encounter issues, feel free to open an issue on GitHub. Wish you win!

About

Welcome to WarCardGameAI! This project revitalizes the classic "War" card game by integrating advanced artificial intelligence. Players can choose a theme, and the game dynamically generates cards with unique descriptions and images based on that theme.

Topics

Resources

Stars

Watchers

Forks

Languages