Inspiration

This is the game we have been playing since childhood, I would love to make this kind of games and I will make one of the best games and publish it!

What it does

The game is played by two individuals. First, we draw a board with a 3×3 square grid. The first player chooses ‘X’ and draws it on any of the square grid, then it’s the chance of the second player to draw ‘O’ on the available spaces. Like this, the players draw ‘X’ and ‘O’ alternatively on the empty spaces until a player succeeds in drawing 3 consecutive marks either in the horizontal, vertical or diagonal way. Then the player wins the game otherwise the game draws when all spots are filled.

How we built it

I have created this game with a very popular Library of python pygame then draw a grid on the canvas where we will play Tic Tac Toe. The status bar below the canvas show which player’s turn is it and who wins the game. When someone wins the game or the game is a draw then we reset the game.

  1. Initializing game components
  2. Initializing Pygame window
  3. Load and transform images
  4. Define the functions ## What we learned With this project in Python, I have successfully made the Tic Tac Toe game. As I mentioned earlier I used the popular pygame library for rendering graphics on a display window. I also learned how to capture events from the keyboard or mouse and trigger a function when the mouse button is pressed. This way we can calculate mouse position, draw X or O on the display and check if the player wins the game or not. ## What's next for Tic-tac-toe Game

Built With

Share this project:

Updates