v0.8.0: roughly implemented new DK level

This commit is contained in:
Evan Debenham
2020-01-30 19:12:13 -05:00
parent e24eca94b4
commit 48471bbfef
12 changed files with 633 additions and 34 deletions

View File

@@ -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 );