This commit is contained in:
adrienmalin 2019-02-25 22:36:29 +01:00
parent 1e1d88ad69
commit 56ea9bc63a
2 changed files with 2 additions and 2 deletions

View File

@ -205,7 +205,7 @@ class Tetris:
def hold_piece(self): def hold_piece(self):
if self.current_piece.hold_enabled: if self.current_piece.hold_enabled:
self.current_piece, self.hold_piece = self.held_piece, self.current_piece self.current_piece, self.held_piece = self.held_piece, self.current_piece
self.held_piece.minoes_positions = self.held_piece.MINOES_POSITIONS self.held_piece.minoes_positions = self.held_piece.MINOES_POSITIONS
self.held_piece.hold_enabled = False self.held_piece.hold_enabled = False
self.new_piece() self.new_piece()

View File

@ -286,6 +286,7 @@ class ControlsWindow(Window, ControlsParser):
ControlsParser.__init__(self) ControlsParser.__init__(self)
self.read(self.FILE_PATH) self.read(self.FILE_PATH)
Window.__init__(self, game, width, height, begin_x, begin_y) Window.__init__(self, game, width, height, begin_x, begin_y)
self.refresh()
for action, key in self.items(self.SECTION): for action, key in self.items(self.SECTION):
if key == "SPACE": if key == "SPACE":
self[action] = " " self[action] = " "
@ -395,7 +396,6 @@ class Game(Tetris):
self.hold_window.refresh() self.hold_window.refresh()
self.next_window.refresh() self.next_window.refresh()
self.stats_window.refresh() self.stats_window.refresh()
self.controls_window.refresh()
scheduler.repeat("time", 1, self.stats_window.refresh_time) scheduler.repeat("time", 1, self.stats_window.refresh_time)
scheduler.repeat("input", self.AUTOSHIFT_DELAY, self.process_input) scheduler.repeat("input", self.AUTOSHIFT_DELAY, self.process_input)