Show problem on GUI

This commit is contained in:
snsd0805 2020-06-29 01:13:30 +08:00
parent 1a68e3b3dd
commit b62d6adc5e
2 changed files with 11 additions and 3 deletions

View File

@ -22,9 +22,16 @@ def drawerReceive(sock,screen):
if data[0:6] == "[list]":
drawUserList(data,screen)
def sendDraw(sock,nowUserList,screen):
def sendDraw(sock,nowUserList,screen,problem):
# Set white background
screen.fill((255, 255, 255))
# Set problem font
pgStringVar = pygame.font.Font(None,30).render("Problem: {}".format(problem),False,(0,0,0))# 文字物件
screen.blit(pgStringVar,(30,450))
white= (255, 255, 255)
black= (0, 0, 0)
clock= pygame.time.Clock()

View File

@ -235,9 +235,10 @@ class Client:
while not continueFlag:
data = sock.recv(1024).decode('utf-8')
role = data[1:5]
problem = data.split(' ')[1]
#print("Role: ",role)
if role == "prob":
draw.sendDraw(sock,userList,screen)
draw.sendDraw(sock,userList,screen,problem)
continueFlag = True
elif role == "gues":
draw.receiveDraw(sock,screen)