dunno why but setting camera position to negative works...

This commit is contained in:
minjaesong
2017-07-03 23:42:59 +09:00
parent 7e417ed8c7
commit 6057bd9c22
10 changed files with 112 additions and 72 deletions

View File

@@ -14,7 +14,7 @@ class Hitbox(x1: Double, y1: Double, width: Double, height: Double) {
@Volatile var hitboxStart: Point2d
private set
val hitboxEnd: Point2d
inline val hitboxEnd: Point2d
get() = Point2d(hitboxStart.x + width, hitboxStart.y + height)
var width: Double = 0.0
private set
@@ -135,4 +135,8 @@ class Hitbox(x1: Double, y1: Double, width: Double, height: Double) {
operator fun minus(other: Hitbox): Vector2 {
return Vector2(other.centeredX - this.centeredX, other.centeredY - this.centeredY)
}
override fun equals(other: Any?): Boolean {
return this.hitboxStart == (other as Hitbox).hitboxStart && this.hitboxEnd == (other as Hitbox).hitboxEnd
}
}