-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
37 lines (26 loc) · 773 Bytes
/
Copy pathmain.py
File metadata and controls
37 lines (26 loc) · 773 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import pygame, sys
from scripts.board import Board
from scripts.player import Player
pygame.init()
Clock = pygame.time.Clock() #Test update
BoardWidth = 600
BoardHight = 600
screen = pygame.display.set_mode((BoardWidth, BoardHight))
background = pygame.image.load(r"Assets/Board.png")
pygame.display.set_caption("Chess")
Board = Board(screen)
Player1 = Player("White")
Player2 = Player("Black")
Players = [Player1, Player2]
turn = 2
while not Board.gameOver():
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit() #Test
screen.blit(background, (0,0))
player = Players[turn % 2]
Board.run(player)
turn += 1
Clock.tick(60)
print(f"{player.getColour()} WINS!!")