# squarism/Tatris

Cleanup and changed TPiece to rotate in middle of piece.

1 parent e3341da commit 2540e249f72264c363a4b053aebba742c1fd5a90 chris dillon committed Apr 6, 2009
Showing with 24 additions and 22 deletions.
1. +1 −2 IPiece.pde
2. +4 −0 OPiece.pde
3. +5 −6 PlayState.pde
4. +14 −14 TPiece.pde
 @@ -24,8 +24,7 @@ class IPiece extends Piece { } public void setRotation(float angle) { - println(angle); - + // this just rotates two ways back and forth if(angle >= radians(0.0f) && angle <= radians(90.0f)) { this.rotation = radians(90.0f); } else if (angle >= radians(90.0f) && angle <= radians(180.0f)) {
 @@ -21,6 +21,10 @@ class OPiece extends Piece { super.round(blocks[3]); } + public void setRotation(float angle) { + // do nothing and like it + } + /* Call this whenever moving or rotating */ public void update() {
 @@ -178,6 +178,7 @@ public class PlayState implements GameState { }*/ // side colli test + /* int tmp = gridSizeY-1; for (int k=0; k<8; k++){ @@ -187,7 +188,7 @@ public class PlayState implements GameState { } } tmp--; - } + }*/ } @@ -534,8 +535,6 @@ public class PlayState implements GameState { } } - - // new piece HERE //currentPiece = new LPiece(playField[1].getX() / 2, 32.0f); //currentPiece = pieceBag.getPiece(); @@ -609,7 +608,7 @@ public class PlayState implements GameState { int x = fx.intValue() - 2; if (x > 0) { int y = fy.intValue() - 1; - println("testing:" + x + "," + y); + //println("testing:" + x + "," + y); // we hit something on the grid if(deadGrid[x-1][y-1] != null) { println("deny left"); @@ -679,7 +678,7 @@ public class PlayState implements GameState { //println (columns[i]); // store the least Y value for yStart later - println("YB:" + yBlocks[i].getX() + "," + yBlocks[i].getY()); + //println("YB:" + yBlocks[i].getX() + "," + yBlocks[i].getY()); } // search down columns with Y in current piece @@ -707,7 +706,7 @@ public class PlayState implements GameState { // remember where we hit the grid hitPoints.add(hitPoint); - println(hitPoint.getX() + "," + hitPoint.getY() + "hitsomething=" + hitSomething); + //println("hitPoints: " + hitPoint.getX() + "," + hitPoint.getY() + "hitsomething=" + hitSomething); } } }