API: AI control on HumanoidNPC

Former-commit-id: ca8fe2f23f6d1bc36f86445017f9a3fdfe6fa2de
Former-commit-id: a0f3233a44a79b4f5bbc9f0c8f19b71df11bedd6
This commit is contained in:
Song Minjae
2016-10-26 00:36:41 +09:00
parent 1840262cc2
commit cd4c9d5b34
9 changed files with 170 additions and 94 deletions

View File

@@ -106,6 +106,38 @@ open class HumanoidNPC(aiFile: String, born: GameDate) : ActorHumanoid(born), AI
}
override fun moveLeft() { // hit the buttons on the controller box
isLeftDown = true
}
override fun moveRight() { // hit the buttons on the controller box
isRightDown = true
}
override fun moveUp() { // hit the buttons on the controller box
isUpDown = true
}
override fun moveDown() { // hit the buttons on the controller box
isDownDown = true
}
override fun moveJump() { // hit the buttons on the controller box
isJumpDown = true
}
/** fly toward arbitrary angle WARNING: the map is looped! */
override fun moveTo(bearing: Double) {
// if your NPC should fly, override this
throw UnsupportedOperationException("Humans cannot fly :p")
}
/** fly toward arbitrary coord WARNING: the map is looped! */
override fun moveTo(toX: Double, toY: Double) {
// if your NPC should fly, override this
throw UnsupportedOperationException("Humans cannot fly :p")
}
var currentExecutionThread = Thread()
var threadRun = false