Ejemplo n.º 1
0
def start_game():
    global lis1
    client.send(lis1)
    start_gui()
    for y in range(22):
    	for x in range(6):
    		if x > 0:
	    		data = client.recv(4096)
	    		global lis
	    		lis = pickle.loads(data)
	    		lis2 = pickle.dumps(lis)
	    		client.send(lis2)
	    		print(lis)
	    	else:
	    		labeltext = "Move of Player no." + str(x)
	    		ui.label.setText(labeltext)
	    		det_moves(rules.poss_mov_det(lis[x][0],x),x)
	    		lis1 = pickle.dumps(lis)
	    		client.send(lis1)
	    	play_move()
Ejemplo n.º 2
0
 def find_move(self, x):
     labeltext = "Move of Player no." + str(x)
     self.label.setText(labeltext)
     self.det_moves(rules.poss_mov_det(self.lis[x][0], x), x)
     e1.set()
Ejemplo n.º 3
0
def start_game():
    global lis
    data = mysocket.recv(4096)
    lis = pickle.loads(data)
    print (lis)
    ui.label.setEnabled(True)

    x1 = int(lis[1][1])
    y1 = int(lis[1][2])

    x2 = int(lis[2][1])
    y2 = int(lis[2][2])

    x3 = int(lis[3][1])
    y3 = int(lis[3][2])

    x4 = int(lis[4][1])
    y4 = int(lis[4][2])

    x5 = int(lis[5][1])
    y5 = int(lis[5][2])

    xx = int(lis[0][1])
    xy = int(lis[0][2])

    pix2 = QPixmap(os.getcwd() + "/resources/images/flag1.gif")
    pix3 = QPixmap(os.getcwd() + "/resources/images/flag2.gif")
    pix4 = QPixmap(os.getcwd() + "/resources/images/flag3.gif")
    pix5 = QPixmap(os.getcwd() + "/resources/images/flag4.gif")
    pix6 = QPixmap(os.getcwd() + "/resources/images/flag5.gif")

    global pixmapItem2
    global pixmapItem3
    global pixmapItem4
    global pixmapItem5
    global pixmapItem6
    pixmapItem2 = scene.addPixmap(pix2)
    pixmapItem3 = scene.addPixmap(pix3)
    pixmapItem4 = scene.addPixmap(pix4)
    pixmapItem5 = scene.addPixmap(pix5)
    pixmapItem6 = scene.addPixmap(pix6)

    pixmapItem2.setOffset(x1,y1-50)
    pixmapItem3.setOffset(x2,y2-50)
    pixmapItem4.setOffset(x3,y3-50)
    pixmapItem5.setOffset(x4,y4-50)
    pixmapItem6.setOffset(x5,y5-50)
    ui.pushButton.setEnabled(True)
    ui.pushButton_3.setEnabled(True)
    ui.pushButton_4.setEnabled(False)
    ui.comboBox.setEnabled(True)

    for y in range(22):
        for x in range(6):
            if x ==  det_no:
                labeltext = "Move of Detective no." + str(x)
                ui.label.setText(labeltext)
                det_moves(rules.poss_mov_det(lis[x][0],x),x)
                lis1 = pickle.dumps(lis)
                mysocket.send(lis1)
            else:
                data = mysocket.recv(4096)
                lis = pickle.loads(data)
                print (lis)
            play_move()