board.py
Sat Aug 06 2022 01:34:05 GMT+0000 (Coordinated Universal Time)
Saved by
@projectpython
import pygame
class Board:
# a class to manage the board
def __init__(self, game):
# Create board
self.screen = game.screen
self.screen_rect = game.screen.get_rect()
# Load the board image
# and get its "rect"
self.image = pygame.image.load('tictactoeImage.png')
self.rect = self.image.get_rect()
# Center the board
self.rect.centerx = self.screen_rect.centerx
self.rect.top = self.screen_rect.top
# blitme draws the board onto the screen
def blitme(self):
self.screen.blit(self.image, self.rect)
content_copyCOPY
Comments