public override void Rotate() { if (rState == RotationState.first) { Brick1.Rect.Y -= 16; Brick1.Coordinate -= 10; Brick3.Rect.X += 16; Brick3.Rect.Y -= 16; Brick3.Coordinate -= 9; Brick4.Rect.X += 16; Brick4.Coordinate++; rState = RotationState.second; } else if (rState == RotationState.second) { if (MovementFunctions.BounderyCoordinate(Brick1.Coordinate) > 0 && MovementFunctions.LeftBounderyCollision(this)) { Brick1.Rect.Y += 16; Brick1.Coordinate += 10; Brick3.Rect.X -= 16; Brick3.Rect.Y += 16; Brick3.Coordinate += 9; Brick4.Rect.X -= 16; Brick4.Coordinate--; rState = RotationState.first; } } }
public override void Rotate() { if (rState == RotationState.second) { if (MovementFunctions.BounderyCoordinate(Brick2.Coordinate) > 0) { Brick1.Rect.X -= 16; Brick1.Rect.Y += 16; Brick1.Coordinate += 9; Brick3.Rect.Y -= 16; Brick3.Rect.X += 32; Brick3.Coordinate -= 8; Brick4.Rect.X += 16; Brick4.Coordinate++; rState = RotationState.first; } } else if (rState == RotationState.first) { Brick1.Rect.X += 16; Brick1.Rect.Y -= 16; Brick1.Coordinate -= 9; Brick3.Rect.Y -= 16; Brick3.Coordinate -= 10; Brick4.Rect.X -= 16; Brick4.Coordinate--; rState = RotationState.third; } else if (rState == RotationState.third) { if (MovementFunctions.BounderyCoordinate(Brick2.Coordinate) > 1) { Brick1.Rect.X -= 16; Brick1.Coordinate--; Brick3.Rect.Y += 16; Brick3.Rect.X -= 32; Brick3.Coordinate += 8; Brick4.Rect.X += 16; Brick4.Rect.Y -= 16; Brick4.Coordinate -= 9; rState = RotationState.fourth; } } else if (rState == RotationState.fourth) { Brick1.Rect.X += 16; Brick1.Coordinate++; Brick3.Rect.Y += 16; Brick3.Coordinate += 10; Brick4.Rect.X -= 16; Brick4.Rect.Y += 16; Brick4.Coordinate += 9; rState = RotationState.second; } }