code cleanup related to ActorWithPhysics

This commit is contained in:
minjaesong
2017-05-10 21:02:05 +09:00
parent 57419a9a24
commit 4f52a4d09b
6 changed files with 15 additions and 12 deletions

View File

@@ -55,13 +55,14 @@ internal class AILuaAPI(g: Globals, actor: ActorWithPhysics) {
*/
fun composeActorObject(actor: ActorWithPhysics): LuaTable {
val t: LuaTable = LuaTable()
val moveDelta = actor.externalForce + actor.controllerMoveDelta
t["name"] = actor.actorValue.getAsString(AVKey.NAME).toLua()
t["posX"] = actor.hitbox.centeredX.toLua()
t["posY"] = actor.hitbox.centeredY.toLua()
t["veloX"] = actor.moveDelta.x.toLua()
t["veloY"] = actor.moveDelta.y.toLua()
t["veloX"] = moveDelta.x.toLua()
t["veloY"] = moveDelta.y.toLua()
t["width"] = actor.hitbox.width.toLua()
t["height"] = actor.hitbox.height.toLua()