Code Monkey home page Code Monkey logo

gamer's Introduction

Coin Toss and Dice Roll Game

This is a simple game that simulates a coin toss and a dice roll. The game allows the player to enter a voucher code, and if the code is valid, the game proceeds. The coin is tossed, and based on the result, either another coin toss or a dice roll is performed. The game interface includes animations for the coin toss and dice roll.

Dependencies

  • tkinter: Used for creating the graphical user interface (GUI).
  • PIL: Required for resizing and displaying images in the GUI.

Installation

  1. Clone the repository:
git clone https://github.com/EmmanuelMmanda/Gamer.git
  1. Navigate to the project directory:
cd Gamer
  1. Install the dependencies using pip:
pip install -r requirements.txt

Usage

To run the game, execute the following command:

python game.py
  1. The game window will open, displaying an input field for the voucher code and a "Play" button.
  2. Enter a valid voucher code and click "Play".
  3. The coin toss animation will be shown, and the result (either "Head" or "Tail") will be displayed.
  4. If the result is "Head", the dice roll animation will be shown, and the dice roll result (an integer between 1 and 6) will be displayed.
  5. If the result is "Tail", another coin toss animation will be shown. If the second toss result is "Head", the dice roll animation will be displayed, and the dice roll result will be shown. If the second toss result is "Tail", the game will end, displaying a "Game Over" message.
  6. After the coin toss or dice roll, the player can restart the game by clicking the "Restart Game" button.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvement, please open an issue or submit a pull request.

Acknowledgements

The game uses the following images from Pixabay under the Pixabay License:

  • Coin images: head.png and tail.png
  • Dice images: 1.png, 2.png, 3.png, 4.png, 5.png, and 6.png

Enjoy playing the Coin Toss and Dice Roll Game! If you have any questions or feedback, feel free to contact me.

gamer's People

Contributors

emmanuelmmanda avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.