mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-18 22:44:04 +09:00
loading player from json file
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user