Fix mirrored version of 'Next' piece. Reset rotation when a piece snaps

on the field.
This commit is contained in:
sigonasr2 2020-08-16 13:59:34 +09:00
parent 489a043441
commit 73b47ebec9
3 changed files with 2 additions and 1 deletions

Binary file not shown.

View File

@ -68,7 +68,7 @@ public class GameCanvas extends JPanel implements KeyListener{
g.fill3DRect(NEXTPIECE_DISPLAYX, NEXTPIECE_DISPLAYY, 104, 104, true); g.fill3DRect(NEXTPIECE_DISPLAYX, NEXTPIECE_DISPLAYY, 104, 104, true);
for (Point p : nextPoints) { for (Point p : nextPoints) {
g.setColor(Game.p.getNextShape().col.getColor()); g.setColor(Game.p.getNextShape().col.getColor());
g.fill3DRect(p.x*BLOCK_SIZE+NEXTPIECE_DISPLAYX+52, p.y*BLOCK_SIZE+NEXTPIECE_DISPLAYY+52, BLOCK_SIZE, BLOCK_SIZE, false); g.fill3DRect(p.x*BLOCK_SIZE+NEXTPIECE_DISPLAYX+52, -p.y*BLOCK_SIZE+NEXTPIECE_DISPLAYY, BLOCK_SIZE, BLOCK_SIZE, false);
} }
g.setColor(java.awt.Color.WHITE); g.setColor(java.awt.Color.WHITE);
g.setFont(displayText); g.setFont(displayText);

View File

@ -20,6 +20,7 @@ public class Player {
public void ShuffleNextPiece() { public void ShuffleNextPiece() {
piece = nextPiece.clone(); piece = nextPiece.clone();
nextPiece = SelectRandomTetrimino(); nextPiece = SelectRandomTetrimino();
Game.rotation=0;
pos = new Point(5,21); pos = new Point(5,21);
} }