mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-10 10:34:06 +09:00
lightning bolt WIP, player sprite declaration macro
Former-commit-id: d4999cda37bff2aa27615183aa125bfbc8cfa975 Former-commit-id: 224aee51d4fb7e5fe9d11bf3c0cc758a5604251d
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package net.torvald.point
|
||||
|
||||
import net.torvald.terrarum.gameactors.sqr
|
||||
import net.torvald.terrarum.gameactors.sqrt
|
||||
import org.dyn4j.geometry.Vector2
|
||||
|
||||
/**
|
||||
@@ -46,4 +48,6 @@ class Point2d(var x: Double, var y: Double) : Cloneable {
|
||||
operator fun div(other: Point2d) = Point2d(x / other.x, y / other.y)
|
||||
|
||||
fun toVector() = Vector2(x, y)
|
||||
|
||||
fun length(other: Point2d) = ((this.x - other.x).sqr() + (this.y - other.y).sqr()).sqrt()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user