feat: add wall kick off the top of well

This commit is contained in:
2021-07-15 10:37:09 -04:00
parent ad5b91d59a
commit 640b8702bd
2 changed files with 19 additions and 1 deletions

View File

@@ -206,6 +206,24 @@ class Piece(Entity):
else:
# successful kick to the right
return True
# trying kick from top
self.move((0, self._tile_size))
self._rotate(True)
if well and self.collide(well) or stack and self.collide(stack):
self.revert()
else:
# successful kick from top
return True
# trying kick 2 tiles from top
self.move((0, self._tile_size * 2))
self._rotate(True)
if well and self.collide(well) or stack and self.collide(stack):
self.revert()
else:
# successful kick 2 tiles from top
return True
else:
return True

View File

@@ -157,7 +157,7 @@ class SinglePlayerScene(Scene):
SoundManager.play_level_up_sfx()
def _get_level(self) -> int:
return 0 if not self._stack else self._stack.total_lines // self._lines_per_level
return 0 if self._stack is None else self._stack.total_lines // self._lines_per_level
def _clear_current_piece(self) -> None:
self._current_piece = None