RPGJS 进阶分析之 Event Class

本文详细介绍了一款游戏开发中事件脚本的功能与使用方法,包括鼠标事件、检测事件、移动控制、效果处理等模块。通过这些脚本,开发者可以实现复杂的玩家交互与角色行为逻辑。
//鼠标事件
//Defines the position and size of the square on the event that triggers the event of the mouse (onMouseOver and onMouseOut)
setMouseElement
moveType
click
//检测相关函数
_contackWith
contactWithEvent
//The event detects the hero in his field of vision
detectionPlayer
//Detects events around this event. Events are refreshed to activate a page with the trigger condition "detection"
detectionEvents
getEventBeside
getEventAround
//事件效果相关函数
fadeOut
fadeIn
blink
visible
//Event waiting for a number of frames
wait
//Animation Event
animation
//Sprite updates of the event. Verify that the Sprite has been removed from the layer
changeBitmap
refreshBitmap
setCharacterHue
//Refresh event. The properties of the right page is assigned to the event. The appearance of the event may also change if the picture is different
refresh
//Set the camera to the event. Moving the map will be based on this event
fixCamera
//移动相关函数
distance
setStopDirection
turnTowardPlayer
moveAwayFromPlayer
directionRelativeToPlayer
_setBehaviorMove()
_isBehaviorMove()
approachPlayer
moveStop
moveStart
moveRandom
canMove
//Move the event by specifying a path
move
jump
//Perform an action on the event. The action must first be added. See "addAction" in class Rpg
action
turn
//Find the shortest path between the position of the event and a final position
pathfinding
pathMove
//Assigns a fixed position on the map. Put the animation to stop
setPosition
setPositionReal
_setPosition
setTypeMove
//经验与级别相关函数
//Experience points necessary for each level.
makeExpList
//Adds experience points. Changes level according to the experience points given. makeExpList() must be called before addExp()
addExp
setExp
//Sets the level of the event. Fixed points depending on the level of experience assigned
setLevel
_changeSkills
setParam
getCurrentParam
//物品相关函数
equipItem
itemIsEquiped
removeItemEquiped
getItemsEquipedByType
//Change the class of the event
setClass
//Fixed elements to the event
setElements
//技能相关函数
learnSkill
skillsToLearn
setSkillToLearn
removeSkill
setSkill
getSkill
//状态相关函数
addState
removeState
stateInflicted
_tickState
其他函数
Event(prop,rpg,name)
initialize
init_tab_move
//Enables or disables a local switch. The event is then refreshed
setSelfSwitch
//Whether a local switch is activated
selfSwitchesIsOn
setIndexBefore
setIndexAfter
getIndex
//Create an event depending on the position of the current event
createEventRelativeThis
commandsExit
getElementById
setPage
bind
call
tick
_trigger

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值