lightning bolt WIP, player sprite declaration macro

Former-commit-id: d4999cda37bff2aa27615183aa125bfbc8cfa975
Former-commit-id: 224aee51d4fb7e5fe9d11bf3c0cc758a5604251d
This commit is contained in:
Song Minjae
2016-10-31 13:26:26 +09:00
parent e4886acc92
commit 5e82f87ee5
8 changed files with 92 additions and 108 deletions

View File

@@ -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()
}