loading player from json file

This commit is contained in:
minjaesong
2021-08-28 16:31:06 +09:00
parent 29cccea19b
commit b84a0a770b
31 changed files with 308 additions and 145 deletions

View File

@@ -11,18 +11,15 @@ import org.dyn4j.geometry.Vector2
*
* Created by minjaesong on 2016-01-15.
*/
class Hitbox (x1: Double, y1: Double, width: Double, height: Double, var suppressWarning: Boolean = true) {
class Hitbox {
@Volatile var hitboxStart: Point2d
private set
inline val hitboxEnd: Point2d
get() = Point2d(hitboxStart.x + width, hitboxStart.y + height)
var width: Double = 0.0
private set
var height: Double = 0.0
private set
var suppressWarning = true
private constructor()
constructor(x1: Double, y1: Double, width: Double, height: Double, suppressWarning: Boolean = true) : this() {
this.suppressWarning = suppressWarning
init {
hitboxStart = Point2d(x1, y1)
this.width = width
this.height = height
@@ -33,6 +30,15 @@ class Hitbox (x1: Double, y1: Double, width: Double, height: Double, var suppres
}
}
@Volatile var hitboxStart: Point2d = Point2d(-1.0, -1.0)
private set
inline val hitboxEnd: Point2d
get() = Point2d(hitboxStart.x + width, hitboxStart.y + height)
var width: Double = 0.0
private set
var height: Double = 0.0
private set
val startX: Double
get() = hitboxStart.x