Rotating Tetris Piece

BlitzMax Forums/BlitzMax Beginners Area/Rotating Tetris Piece

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I'm having difficulty getting pieces to rotate properly in my Tetris game. I can get them to rotate 90 degrees exactly, but if you play a decent game of Tetris you will notice that they rotate about a specific block, or pivot, in the piece, not just the top left corner. I've tried for ages to figure it out but I just can't :( The type TPiece has an array of TPoint, which contains a relative X and Y (ie 0, 0 1, 0 2, 0 1, 1 for T) and fields for the coordinates of the pivot (ie 1, 0). Any help will be much appreciated.