Game_Character ⇐ Game_CharacterBase
Game_Character
Kind: global class
Extends: Game_CharacterBase
- Game_Character ⇐
Game_CharacterBase
- new Game_Character()
- instance
- .isMoveRouteForcing() ⇒
boolean
- .setMoveRoute(moveRoute)
- .forceMoveRoute(moveRoute)
- .updateStop()
- .updateRoutineMove()
- .processMoveCommand(command)
- .deltaXFrom(x) ⇒
number
- .deltaYFrom(y) ⇒
number
- .moveRandom()
- .moveTowardCharacter(character)
- .moveAwayFromCharacter(character)
- .turnTowardCharacter(character)
- .turnAwayFromCharacter(character)
- .turnTowardPlayer()
- .turnAwayFromPlayer()
- .moveTowardPlayer()
- .moveAwayFromPlayer()
- .moveForward()
- .moveBackward()
- .processRouteEnd()
- .advanceMoveRouteIndex()
- .turnRight90()
- .turnLeft90()
- .turn180()
- .turnRightOrLeft90()
- .turnRandom()
- .swap(character)
- .findDirectionTo(goalX, goalY) ⇒
number
- .searchLimit() ⇒
number
- .isMoveRouteForcing() ⇒
- static
- .ROUTE_END :
Number
- .initialize()
- .initMembers()
- .memorizeMoveRoute()
- .restoreMoveRoute()
- .ROUTE_END :
new Game_Character()
游戏人物类,是 Game_Player、Game_Follower、GameVehicle 和 Game_Event 的父类
Game character class, the superclass of Game_Player, Game_Follower, GameVehicle, and Game_Event
game_Character.isMoveRouteForcing() ⇒ boolean
是否强制移动
Check if move route forcing
Kind: instance method of Game_Character
Returns: boolean
- 是否强制移动 / Whether move route forcing
game_Character.setMoveRoute(moveRoute)
设置移动路线
Set move route
Kind: instance method of Game_Character
Param | Type | Description |
---|---|---|
moveRoute | object | 移动路线对象 / Move route object |
game_Character.forceMoveRoute(moveRoute)
强制移动路线
Force move route
Kind: instance method of Game_Character
Param | Type | Description |
---|---|---|
moveRoute | object | 移动路线对象 / Move route object |
game_Character.updateStop()
更新停止
Update stop
Kind: instance method of Game_Character
game_Character.updateRoutineMove()
更新一系列移动
Update routine move
Kind: instance method of Game_Character
game_Character.processMoveCommand(command)
处理移动指令
Process move command
Kind: instance method of Game_Character
Param | Type | Description |
---|---|---|
command | object | 移动指令对象 / Move command object |
game_Character.deltaXFrom(x) ⇒ number
与该 X 位置差值
Get delta X from specified position
Kind: instance method of Game_Character
Returns: number
- X 坐标差值 / Delta X
Param | Type | Description |
---|---|---|
x | number | X 坐标 / X coordinate |
game_Character.deltaYFrom(y) ⇒ number
与该 Y 位置差值
Get delta Y from specified position
Kind: instance method of Game_Character
Returns: number
- Y 坐标差值 / Delta Y
Param | Type | Description |
---|---|---|
y | number | Y 坐标 / Y coordinate |
game_Character.moveRandom()
随机移动
Move random
Kind: instance method of Game_Character
game_Character.moveTowardCharacter(character)
接近该人物移动
Move toward character
Kind: instance method of Game_Character
Param | Type | Description |
---|---|---|
character | Game_CharacterBase | 目标人物 / Target character |
game_Character.moveAwayFromCharacter(character)
远离该人物移动
Move away from character
Kind: instance method of Game_Character
Param | Type | Description |
---|---|---|
character | Game_CharacterBase | 目标人物 / Target character |
game_Character.turnTowardCharacter(character)
朝向该人物
Turn toward character
Kind: instance method of Game_Character
Param | Type | Description |
---|---|---|
character | Game_CharacterBase | 目标人物 / Target character |
game_Character.turnAwayFromCharacter(character)
背向该人物
Turn away from character
Kind: instance method of Game_Character
Param | Type | Description |
---|---|---|
character | Game_CharacterBase | 目标人物 / Target character |
game_Character.turnTowardPlayer()
朝向玩家
Turn toward player
Kind: instance method of Game_Character
game_Character.turnAwayFromPlayer()
背向玩家
Turn away from player
Kind: instance method of Game_Character
game_Character.moveTowardPlayer()
接近玩家
Move toward player
Kind: instance method of Game_Character
game_Character.moveAwayFromPlayer()
远离玩家
Move away from player
Kind: instance method of Game_Character
game_Character.moveForward()
前进一步
Move forward
Kind: instance method of Game_Character
game_Character.moveBackward()
后退一步
Move backward
Kind: instance method of Game_Character
game_Character.processRouteEnd()
处理路线结束
Process route end
Kind: instance method of Game_Character
game_Character.advanceMoveRouteIndex()
增加移动路线索引
Advance move route index
Kind: instance method of Game_Character
game_Character.turnRight90()
右转 90°
Turn right 90 degrees
Kind: instance method of Game_Character
game_Character.turnLeft90()
左转 90°
Turn left 90 degrees
Kind: instance method of Game_Character
game_Character.turn180()
后转 180°
Turn 180 degrees
Kind: instance method of Game_Character
game_Character.turnRightOrLeft90()
向左或向右转 90°
Turn right or left 90 degrees
Kind: instance method of Game_Character
game_Character.turnRandom()
随机转向
Turn random
Kind: instance method of Game_Character
game_Character.swap(character)
交换
Swap
交换两个人的位置。
Exchange positions of two characters.
Kind: instance method of Game_Character
Param | Type | Description |
---|---|---|
character | Game_CharacterBase | 要交换位置的人物 / Character to swap positions with |
game_Character.findDirectionTo(goalX, goalY) ⇒ number
寻找朝着该位置的方向
Find direction to specified position
该寻路是 A算法的魔改,每走一步查找 12 步内的路径,取出第一步进行行走。
This pathfinding is a modified A algorithm that searches for a path within 12 steps for each move.
Kind: instance method of Game_Character
Returns: number
- 移动方向 / Movement direction
Param | Type | Description |
---|---|---|
goalX | number | 目标 X 坐标 / Goal X coordinate |
goalY | number | 目标 Y 坐标 / Goal Y coordinate |
game_Character.searchLimit() ⇒ number
获取查找上限
Get search limit
Kind: instance method of Game_Character
Returns: number
- 查找上限 / Search limit
Game_Character.ROUTE_END : Number
移动路线常量 - 结束
Route constant - End
Kind: static property of Game_Character
Game_Character.initialize()
初始化
Initialize
Kind: static method of Game_Character
Game_Character.initMembers()
初始化成员
Initialize members
Kind: static method of Game_Character
Game_Character.memorizeMoveRoute()
记录移动路线
Memorize move route
Kind: static method of Game_Character
Game_Character.restoreMoveRoute()
恢复移动路线
Restore move route
Kind: static method of Game_Character