feat: add wall kick off the top of well

This commit is contained in:
Giovani
2021-07-15 10:37:09 -04:00
parent e450b0f3cd
commit 4d23aa3439
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