mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-18 14:34:04 +09:00
API: AI control on HumanoidNPC
Former-commit-id: ca8fe2f23f6d1bc36f86445017f9a3fdfe6fa2de Former-commit-id: a0f3233a44a79b4f5bbc9f0c8f19b71df11bedd6
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user