Ok, I have been scratching my head for a while, because I couldn't rotate an object. So here's what I would like to know. How do I access shape (an attribute of the class Piece) and how do I change currentPiece (which is an instance of the class object Piece)

I'm not 100% on Java so I may be wrong here, hopefully someone can correct me if I am, but although 'currentPiece' is public it is still inside the 'Tetris' class so the 'Piece' class cannot access it directly as you have, but it can access it through a 'Tetris' object. So it would be something like "Tetris.currentPiece", similar to the 'fall()' method where "Tetris.sleep(2000)" is used.

On a side note, there is a way of determining the rotation of Tetris pieces without having to store that location as you have in matrices (some people would argue that using tables is better as there is a limited number of shapes, but I prefer the algorithm personally).

You define a block in the shape that will be the centre block that will be used to rotate around.

Each other block is then defined in "shape space" relative to the centre, i.e. a block one column to the left will be [-1,0] relative to the centre block.

When rotating (CW) the new row is the negative of the current column and the new column is the current row. So from the example above would become [0,1]. (This is still in "shape space", so is an offset from the centre block).

For CCW rotation the negative is for the new column instead of the new row.

Below is a posting of my code performing the above (note this is in C++ not java);

currentPiece is the variable name you give the piece in the Tetris class. However, since this method is a member of the Piece class, just replace "currentPiece" with "this". That will make the method operate on its own instance, which is what you want it to do (and how you're using the method call in the Tetris class, anyway).

Quick edit: been a while since I broke Java, but I'm actually unsure if using "this = new Piece()" will be legit. You might want to move this functionality into the Tetris class instead, or rethink your method of rotation. Or I could be fretting over nothing and Java will handle this just fine. I'm rusty there.

Either way, you can definitely use the "this" keyword in the multiplyMatrix call.