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

on the field.
master
sigonasr2 5 years ago
parent 489a043441
commit 73b47ebec9
  1. BIN
      Tetris/Tetris.jar
  2. 2
      Tetris/src/sig/game/GameCanvas.java
  3. 1
      Tetris/src/sig/game/Player.java

Binary file not shown.

@ -68,7 +68,7 @@ public class GameCanvas extends JPanel implements KeyListener{
g.fill3DRect(NEXTPIECE_DISPLAYX, NEXTPIECE_DISPLAYY, 104, 104, true);
for (Point p : nextPoints) {
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.setFont(displayText);

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

Loading…
Cancel
Save