Add triangle on last move, to make long-running games easier to keep track of.
This commit is contained in:
parent
21b5930431
commit
9a78f2918a
12
lib/goban.py
12
lib/goban.py
|
@ -23,6 +23,7 @@ class Goban:
|
|||
self.to_move = Goban.BLACK
|
||||
self.black_captures = 0
|
||||
self.white_captures = 0
|
||||
self.last_move = None
|
||||
self.ko = None
|
||||
self.hover = None
|
||||
self.elapsed_time = 0
|
||||
|
@ -54,6 +55,7 @@ class Goban:
|
|||
|
||||
self.board[rpos] = self.to_move
|
||||
self._capture(rpos)
|
||||
self.last_move = rpos
|
||||
|
||||
self.to_move = self._other_color(self.to_move)
|
||||
self.clear_hover()
|
||||
|
@ -194,12 +196,16 @@ class Goban:
|
|||
point = self.board[pos]
|
||||
|
||||
if point == Goban.EMPTY:
|
||||
s = img_res[self.def_draw_codes[pos]]
|
||||
code = self.def_draw_codes[pos]
|
||||
elif point == Goban.BLACK:
|
||||
s = img_res['b']
|
||||
code = 'b'
|
||||
elif point == Goban.WHITE:
|
||||
s = img_res['w']
|
||||
code = 'w'
|
||||
|
||||
if pos == self.last_move:
|
||||
code = code + 'T'
|
||||
|
||||
s = img_res[code]
|
||||
s = pygame.transform.scale(s, (inc, inc))
|
||||
ret.blit(s, ((pos % self.board_size) *inc, (pos / self.board_size) *inc))
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user