mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-16 05:24:06 +09:00
generalised things so that they would work outside of ingame.world; title screen wip
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
package net.torvald.terrarum.gameactors.ai
|
||||
|
||||
import net.torvald.terrarum.gameactors.HumanoidNPC
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 16-03-02.
|
||||
*/
|
||||
interface ActorAI {
|
||||
fun update(delta: Float)
|
||||
fun update(actor: HumanoidNPC, delta: Float)
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
package net.torvald.terrarum.gameactors.ai
|
||||
|
||||
import net.torvald.terrarum.gameactors.Actor
|
||||
import net.torvald.terrarum.gameactors.ActorHumanoid
|
||||
import net.torvald.terrarum.gameactors.ActorWithPhysics
|
||||
import net.torvald.terrarum.gameactors.HumanoidNPC
|
||||
import org.luaj.vm2.Globals
|
||||
import org.luaj.vm2.LuaError
|
||||
import org.luaj.vm2.LuaInteger
|
||||
@@ -45,7 +47,7 @@ class LuaAIWrapper(private val scriptPath: String) : ActorAI {
|
||||
luaInstance.call()
|
||||
}
|
||||
|
||||
override fun update(delta: Float) {
|
||||
override fun update(actor: HumanoidNPC, delta: Float) {
|
||||
// run "update()" function in the script
|
||||
luag.get("update").call(delta.toLua())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user