impactjs-eventchain:一个帮助在 ImpactJS 中编写顺序事件脚本的函数

时间:2021-07-01 20:51:55
【文件属性】:
文件名称:impactjs-eventchain:一个帮助在 ImpactJS 中编写顺序事件脚本的函数
文件大小:8KB
文件格式:ZIP
更新时间:2021-07-01 20:51:55
JavaScript Impactjs-事件链 在帮助编写顺序事件的。 概述 在通常使用ig.system.tick和一堆计数器的地方使用 EventChain 来尝试和计时一系列脚本化事件。 链中的每个链接都是脚本中的一个步骤。 几个具体的例子: 每 5 秒产生一个怪物: wait(5).then(function() { ig.game.spawnEntity...; }).repeat() 玩家重生时间:玩家死亡,等待 3 秒,生成玩家实体: then(this.kill).wait(3).then(function() { ig.game.spawnEntity...; }) 制作一个摇摇欲坠的平台,在kill自己之前每隔一段时间摆动一次: wait(0.3).then(this.wobble).wait(0.3).then(this.wobble).wait(0.3).then(this.ki
【文件预览】:
impactjs-eventchain-master
----.travis.yml(80B)
----eventChain.js(5KB)
----package.json(803B)
----test()
--------eventChainSpec.js(10KB)
----.gitignore(14B)
----README.md(7KB)
----.jshintrc(293B)

网友评论