hjfreyer / pentris

Like Tetris, but more so
Apache License 2.0
6 stars 1 forks source link

Implement wall kick #5

Open white0ut opened 5 years ago

white0ut commented 5 years ago

I'm not sure if you've intended to go this route or not, but playing through a few rounds this edge case started to feel more like a bug and less like a design choice.

A) For the piece shaped like

O
O O
  O

If this were pinned on the left wall, you would not be able to rotate it, since I'm betting you've picked a block to rotate on (and for other pieces evenly centered around void space, the rotation would be around that void space, like the inverted "U" piece. But in other tetris games, rotating against the wall would push the piece out of the way to complete the rotation.

The same thing applies when you are on the ground, for example in this position, when seated on the ground

    O
O O O
------

One more rotation should shift the center of mass up 1 degree

O
O
O O
-----

Other shapes like

  O
  O
O O
O

If they are 1 column away from the wall, you can rotate 2 or 3 times and then get stuck. This feels broken to me, I want it to keep rotating, even if that shifts the center of the mass to the right in this example.

I hopped onto another tetris game and it behaved like I described, where the center of mass actually shifts, and it felt much more fluid. Having rotation freeze when on an obstruction broke the flow of the game for me.

hjfreyer commented 5 years ago

Yeah, this is a reasonable feature that many Tetrises have, and it's called a "wall kick". It's more a laziness choice than an intentional one, but the fact that you noticed makes me think it's worth implementing. Especially since the pieces can be even more unwieldy than tetronimos