-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChessGame.py
More file actions
38 lines (28 loc) · 722 Bytes
/
Copy pathChessGame.py
File metadata and controls
38 lines (28 loc) · 722 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
36
37
38
import pygame
from pygame.locals import *
import numpy as np
from time import sleep
pygame.init()
w, h = 500, 500
screen = pygame.display.set_mode((w, h))
screensize = np.int32((w, h))
piecenames = ["", "B", "N", "R", "Q", "K"]
class Piece:
def __init__(self, type="", colour="w"):
pass
def moves(self):
boardarray = np.zeros((8, 8), "int32")
keys = set()
while True:
screen.fill(0)
pygame.display.flip()
for e in pygame.event.get():
if e.type == QUIT:
quit()
elif e.type == KEYDOWN:
keys.add(e.key)
if e.key == K_ESCAPE:
quit()
elif e.type == KEYUP:
keys.discard(e.key)
sleep(0.001)