removed cause of tetris collision bugs (yaw, pitch in Pos)
This commit is contained in:
@@ -44,7 +44,7 @@ public class Tetromino {
|
||||
this.position = new Pos(newPosition.x(), newPosition.y(), newPosition.z());
|
||||
}
|
||||
|
||||
public boolean rotate(boolean clockwise) {
|
||||
public void rotate(boolean clockwise) {
|
||||
int[][] newShapeArray = this.getTurnedShapeArray(clockwise);
|
||||
Orientation newOrientation = this.orientation.rotated(clockwise);
|
||||
|
||||
@@ -53,11 +53,10 @@ public class Tetromino {
|
||||
Pos candidate = new Pos(this.position.x() + k[0], this.position.y() + k[1], this.position.z());
|
||||
if(this.checkCollisionAndMove(candidate, newShapeArray)) {
|
||||
this.orientation = newOrientation;
|
||||
return true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean moveDown() {
|
||||
@@ -65,14 +64,14 @@ public class Tetromino {
|
||||
return this.checkCollisionAndMove(newPosition, this.shapeArray);
|
||||
}
|
||||
|
||||
public boolean moveLeft() {
|
||||
public void moveLeft() {
|
||||
Pos newPosition = this.position.sub(1, 0, 0);
|
||||
return this.checkCollisionAndMove(newPosition, this.shapeArray);
|
||||
this.checkCollisionAndMove(newPosition, this.shapeArray);
|
||||
}
|
||||
|
||||
public boolean moveRight() {
|
||||
public void moveRight() {
|
||||
Pos newPosition = this.position.add(1, 0, 0);
|
||||
return this.checkCollisionAndMove(newPosition, this.shapeArray);
|
||||
this.checkCollisionAndMove(newPosition, this.shapeArray);
|
||||
}
|
||||
|
||||
public void draw() {
|
||||
|
||||
Reference in New Issue
Block a user