MCPcopy
hub / github.com/feichao93/battle-city / delay

Method delay

app/utils/Timing.ts:10–19  ·  view source on GitHub ↗

用于生成等待一段时间的effect. * 该函数作用和delay类似, 不过该函数会考虑游戏暂停的情况

(ms: number)

Source from the content-addressed store, hash-verified

8 /** 用于生成等待一段时间的effect.
9 * 该函数作用和delay类似, 不过该函数会考虑游戏暂停的情况 */
10 static *delay(ms: number) {
11 let acc = 0
12 while (true) {
13 const { delta }: actions.Tick = yield take(actions.A.Tick)
14 acc += delta
15 if (acc >= ms) {
16 break
17 }
18 }
19 }
20
21 static *tween(duration: number, effectFactory: (t: number) => Effect) {
22 let accumulation = 0

Callers 15

shovelFunction · 0.80
scoreFromPickPowerUpFunction · 0.80
blinkFunction · 0.80
animateCurtainAndLoadMapFunction · 0.80
stageSagaFunction · 0.80
addBotHelperFunction · 0.80
hitByTeammateHandlerFunction · 0.80
animateGameoverFunction · 0.80
animateStatisticsFunction · 0.80
explosionFromBulletFunction · 0.80
scoreFromKillTankFunction · 0.80
wanderModeFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected