# tetris rotation

This topic is 4982 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I'm making a game of tetris and its almost done - I just need to implement the rotation. When you rotate a tetrad, which squares should I make sure are empty for the rotation to be able to happen? Thanks.

##### Share on other sites
I would just test the squares that the piece would occupy after the rotation, not any of the squares sort of half way through the rotation.

##### Share on other sites
well what if it looked like this:

****

rotate to look like this:

*
*
*
*

what if the grid (X = already filled cell and 'e' = already empty cell:

eeee
****
eXee
eXee

to this:

ee*e
ee*e
eX*e
eX*e

It would have to pass through two filled squares.

##### Share on other sites
Quote:
 Original post by silverphyre673well what if it looked like this:****rotate to look like this:****what if the grid (X = already filled cell and 'e' = already empty cell:eeee****eXeeeXeeto this:ee*eee*eeX*eeX*eIt would have to pass through two filled squares.

I've never played a tetris implementation that cared. In fact, several high level skills require that not be the implementation.

CM

##### Share on other sites
that makes it easy then! I guess it scrunches up into one square, then reexpands. Yeah. Thanks.

##### Share on other sites
Quote:
 Original post by silverphyre673that makes it easy then! I guess it scrunches up into one square, then reexpands. Yeah. Thanks.
No, think of it as pulling it forwards out of the plane, then turning it, then pushing it back into place.

1. 1
2. 2
Rutin
22
3. 3
4. 4
khawk
14
5. 5

• 13
• 26
• 10
• 11
• 44
• ### Forum Statistics

• Total Topics
633743
• Total Posts
3013643
×