diff --git a/lib/goban.py b/lib/goban.py index ed210f3..310c028 100644 --- a/lib/goban.py +++ b/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))