コード例 #1
0
    def __init__(self):
        # state constant
        self.BLACKTURN = 'BLACKTURN'
        self.WHITETURN = 'WHITETURN'
        self.BLACKWIN = 'BLACKWIN'
        self.WHITEWIN = 'WHITEWIN'
        self.GAMEOVER = 'GAMEOVER'

        # current state
        self.state = self.GAMEOVER

        # Players ('all' or 'any' or some nickname, or 'ai' for white)
        self.black = 'all'
        self.white = 'mouse'

        # deadlines
        self.deadline = 0
        self.allDeadline = 0
        self.promptCountdown = 0

        # new chess data, [[pos1, num1], [pos2, num2], ...]
        self.data = []

        # chessboard
        self.board = chessboard.Chessboard()

        # render screen
        self.screen = pygame.display.set_mode(bg_size)

        # danmuji
        self.dmj = danmuji.Gift(roomID)
        self.dmj.run()

        print('hello')
コード例 #2
0
 def __init__(self):
     # chessboard
     self.chessboard = chessboard.Chessboard()
     # chess
     self.chessqs = chess.createChessqs()
     self.chessQs = chess.createChessQs()
     # arrow
     self.arrowLeft = None
     self.arrowRight = None
     #
     self.idxed = -1
コード例 #3
0
ファイル: gamemanager.py プロジェクト: Avis32/Checkers
    def __init__(self):

        self.chessboard = chessboard.Chessboard(8, 8)
        self.white_player = player.Player('w', self.chessboard)
        self.black_player = player.Player('b', self.chessboard)
        self.chessboard.set_pawns()
コード例 #4
0
ファイル: main.py プロジェクト: houluy/chessboard
import chessboard

c = chessboard.Chessboard()
c.play()

コード例 #5
0
 def createChessboard(self):
     dimension = min(self.xUnit * 8, self.yUnit * 8)
     self.chessboard = chessboard.Chessboard(master=self, x=width / 2.0, y=height / 2.0, w=dimension, h=dimension, variant=self.settings["variant"], orientation=self.settings["color"])
コード例 #6
0
ファイル: test_chessboard.py プロジェクト: houluy/chessboard
 def setUp(self):
     self.chessboard = chessboard.Chessboard()
コード例 #7
0
ファイル: test_chessboard.py プロジェクト: houluy/chessboard
 def setUp(self):
     self.chessboard = chessboard.Chessboard(board_size=7)