Jump to content
  • Advertisement
Sign in to follow this  
silverphyre673

tetris rotation

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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 this post


Link to post
Share on other sites
Quote:
Original post by silverphyre673
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.

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

CM

Share this post


Link to post
Share on other sites
Quote:
Original post by silverphyre673
that 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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!