Fix rotation
This commit is contained in:
parent
428fca40ae
commit
23bb3e1153
@ -141,31 +141,31 @@ impl FallingTetromino {
|
||||
// Straight
|
||||
//
|
||||
(Tetromino::Straight, Direction::North) => [
|
||||
(self.center_x - 2, self.center_y - 1),
|
||||
(self.center_x - 1, self.center_y - 1),
|
||||
(self.center_x, self.center_y - 1),
|
||||
(self.center_x + 1, self.center_y - 1),
|
||||
(self.center_x, self.center_y),
|
||||
(self.center_x, self.center_y + 1),
|
||||
(self.center_x, self.center_y + 2),
|
||||
],
|
||||
|
||||
(Tetromino::Straight, Direction::East) => [
|
||||
(self.center_x + 1, self.center_y - 2),
|
||||
(self.center_x + 1, self.center_y - 1),
|
||||
(self.center_x - 1, self.center_y),
|
||||
(self.center_x, self.center_y),
|
||||
(self.center_x + 1, self.center_y),
|
||||
(self.center_x + 1, self.center_y + 1),
|
||||
(self.center_x + 2, self.center_y),
|
||||
],
|
||||
|
||||
(Tetromino::Straight, Direction::South) => [
|
||||
(self.center_x - 2, self.center_y + 1),
|
||||
(self.center_x - 1, self.center_y + 1),
|
||||
(self.center_x, self.center_y + 1),
|
||||
(self.center_x + 1, self.center_y - 1),
|
||||
(self.center_x + 1, self.center_y),
|
||||
(self.center_x + 1, self.center_y + 1),
|
||||
(self.center_x + 1, self.center_y + 2),
|
||||
],
|
||||
|
||||
(Tetromino::Straight, Direction::West) => [
|
||||
(self.center_x - 1, self.center_y - 2),
|
||||
(self.center_x - 1, self.center_y - 1),
|
||||
(self.center_x - 1, self.center_y),
|
||||
(self.center_x - 1, self.center_y + 1),
|
||||
(self.center_x, self.center_y + 1),
|
||||
(self.center_x + 1, self.center_y + 1),
|
||||
(self.center_x + 2, self.center_y + 1),
|
||||
],
|
||||
|
||||
//
|
||||
@ -234,31 +234,31 @@ impl FallingTetromino {
|
||||
// Left Skew
|
||||
//
|
||||
(Tetromino::SkewLeft, Direction::North) => [
|
||||
(self.center_x - 1, self.center_y),
|
||||
(self.center_x, self.center_y),
|
||||
(self.center_x - 1, self.center_y + 1),
|
||||
(self.center_x, self.center_y + 1),
|
||||
(self.center_x + 1, self.center_y + 1),
|
||||
(self.center_x, self.center_y),
|
||||
(self.center_x + 1, self.center_y),
|
||||
],
|
||||
|
||||
(Tetromino::SkewLeft, Direction::East) => [
|
||||
(self.center_x, self.center_y - 1),
|
||||
(self.center_x, self.center_y),
|
||||
(self.center_x - 1, self.center_y - 1),
|
||||
(self.center_x - 1, self.center_y),
|
||||
(self.center_x - 1, self.center_y + 1),
|
||||
(self.center_x, self.center_y),
|
||||
(self.center_x, self.center_y + 1),
|
||||
],
|
||||
|
||||
(Tetromino::SkewLeft, Direction::South) => [
|
||||
(self.center_x - 1, self.center_y - 1),
|
||||
(self.center_x, self.center_y - 1),
|
||||
(self.center_x - 1, self.center_y),
|
||||
(self.center_x, self.center_y),
|
||||
(self.center_x + 1, self.center_y),
|
||||
(self.center_x, self.center_y - 1),
|
||||
(self.center_x + 1, self.center_y - 1),
|
||||
],
|
||||
|
||||
(Tetromino::SkewLeft, Direction::West) => [
|
||||
(self.center_x + 1, self.center_y - 1),
|
||||
(self.center_x + 1, self.center_y),
|
||||
(self.center_x, self.center_y - 1),
|
||||
(self.center_x, self.center_y),
|
||||
(self.center_x, self.center_y + 1),
|
||||
(self.center_x + 1, self.center_y),
|
||||
(self.center_x + 1, self.center_y + 1),
|
||||
],
|
||||
|
||||
//
|
||||
@ -267,27 +267,27 @@ impl FallingTetromino {
|
||||
(Tetromino::SkewRight, Direction::North) => [
|
||||
(self.center_x - 1, self.center_y),
|
||||
(self.center_x, self.center_y),
|
||||
(self.center_x, self.center_y - 1),
|
||||
(self.center_x + 1, self.center_y - 1),
|
||||
(self.center_x, self.center_y + 1),
|
||||
(self.center_x + 1, self.center_y + 1),
|
||||
],
|
||||
|
||||
(Tetromino::SkewRight, Direction::East) => [
|
||||
(self.center_x, self.center_y + 1),
|
||||
(self.center_x, self.center_y - 1),
|
||||
(self.center_x, self.center_y),
|
||||
(self.center_x + 1, self.center_y),
|
||||
(self.center_x + 1, self.center_y - 1),
|
||||
(self.center_x - 1, self.center_y),
|
||||
(self.center_x - 1, self.center_y + 1),
|
||||
],
|
||||
|
||||
(Tetromino::SkewRight, Direction::South) => [
|
||||
(self.center_x - 1, self.center_y + 1),
|
||||
(self.center_x, self.center_y + 1),
|
||||
(self.center_x - 1, self.center_y - 1),
|
||||
(self.center_x, self.center_y - 1),
|
||||
(self.center_x, self.center_y),
|
||||
(self.center_x + 1, self.center_y),
|
||||
],
|
||||
|
||||
(Tetromino::SkewRight, Direction::West) => [
|
||||
(self.center_x - 1, self.center_y - 1),
|
||||
(self.center_x - 1, self.center_y),
|
||||
(self.center_x + 1, self.center_y - 1),
|
||||
(self.center_x + 1, self.center_y),
|
||||
(self.center_x, self.center_y),
|
||||
(self.center_x, self.center_y + 1),
|
||||
],
|
||||
|
Loading…
x
Reference in New Issue
Block a user