fixed a NaN bug caused by a zero-width/height hitbox

Also inventory is widened to 10x7 of prev 9x7
This commit is contained in:
minjaesong
2018-11-06 04:02:33 +09:00
parent cb78f3dbab
commit 9b087f0ae5
14 changed files with 78 additions and 43 deletions

View File

@@ -71,6 +71,12 @@ class Hitbox(x1: Double, y1: Double, width: Double, height: Double) {
fun setPosition(x1: Double, y1: Double): Hitbox {
hitboxStart = Point2d(x1, y1)
if (width == 0.0 || height == 0.0) {
println("[Hitbox] width or height is zero, perhaps you want to check it out?")
Thread.currentThread().stackTrace.forEach { println(it) }
}
return this
}
fun setPosition(vector: Vector2) = setPosition(vector.x, vector.y)