Compare commits
No commits in common. "504ebf8e514cb79681f4482d4945f70ab0bdbe18" and "e041a8118a9e12f7e4230a628165ecf49becabad" have entirely different histories.
504ebf8e51
...
e041a8118a
@ -375,6 +375,14 @@ AGAIN""".format(
|
||||
next_pieces[-1].sprites = TetrominoSprites(next_pieces[-1], self)
|
||||
for piece, coord in zip(next_pieces, NEXT_PIECES_COORDS):
|
||||
piece.coord = coord
|
||||
piece.sprites.refresh()
|
||||
|
||||
def on_falling_phase(self, falling_piece, ghost_piece):
|
||||
falling_piece.sprites.refresh()
|
||||
ghost_piece.sprites.refresh()
|
||||
|
||||
def on_lock_phase(self, locked_piece):
|
||||
locked_piece.sprites.refresh(texture=LOCKED_TEXTURE)
|
||||
|
||||
def on_locked(self, matrix, locked_piece):
|
||||
for mino in locked_piece:
|
||||
@ -393,7 +401,9 @@ AGAIN""".format(
|
||||
held_piece.coord = HELD_PIECE_COORD
|
||||
if type(held_piece) == I_Tetrimino:
|
||||
held_piece.coord += Movement.LEFT
|
||||
held_piece.sprites.refresh()
|
||||
ghost_piece.sprites = TetrominoSprites(ghost_piece, self, GHOST_ALPHA)
|
||||
ghost_piece.sprites.refresh()
|
||||
|
||||
def pause(self):
|
||||
super().pause()
|
||||
@ -590,14 +600,6 @@ High score could not be saved:
|
||||
arcade.unschedule(_task)
|
||||
arcade.schedule(_task, period)
|
||||
|
||||
def on_update(self, delta_time):
|
||||
for piece in [self.held.piece, self.matrix.ghost] + self.next.pieces:
|
||||
if piece:
|
||||
piece.sprites.refresh()
|
||||
if self.matrix.piece:
|
||||
texture = LOCKED_TEXTURE if self.phase == Phase.LOCK else NORMAL_TEXTURE
|
||||
self.matrix.piece.sprites.refresh(texture=texture)
|
||||
|
||||
def on_close(self):
|
||||
self.save_high_score()
|
||||
if self.music:
|
||||
|
@ -274,9 +274,6 @@ class TetrisLogic:
|
||||
self.stop(self.fall)
|
||||
self.matrix.piece, self.held.piece = self.held.piece, self.matrix.piece
|
||||
|
||||
for mino, coord in zip(self.held.piece, self.held.piece.MINOES_COORDS):
|
||||
mino.coord = coord
|
||||
|
||||
if self.matrix.piece:
|
||||
self.matrix.piece.coord = self.MATRIX_PIECE_COORD
|
||||
self.matrix.ghost = self.matrix.piece.ghost()
|
||||
|
Loading…
x
Reference in New Issue
Block a user