v0.8.0: roughly implemented new DK level
This commit is contained in:
@@ -133,6 +133,12 @@ public class Rect {
|
||||
public boolean inside( Point p ) {
|
||||
return p.x >= left && p.x < right && p.y >= top && p.y < bottom;
|
||||
}
|
||||
|
||||
public Point center() {
|
||||
return new Point(
|
||||
(left + right) / 2 + (((right - left) % 2) == 0 ? Random.Int( 2 ) : 0),
|
||||
(top + bottom) / 2 + (((bottom - top) % 2) == 0 ? Random.Int( 2 ) : 0) );
|
||||
}
|
||||
|
||||
public Rect shrink( int d ) {
|
||||
return new Rect( left + d, top + d, right - d, bottom - d );
|
||||
|
||||
Reference in New Issue
Block a user