MCPcopy Create free account
hub / github.com/NianBroken/Firework_Simulator / updateGlobals

Function updateGlobals

js/script.js:1216–1234  ·  view source on GitHub ↗
(timeStep, lag)

Source from the content-addressed store, hash-verified

1214
1215// Extracted function to keep `update()` optimized
1216function updateGlobals(timeStep, lag) {
1217 currentFrame++;
1218
1219 // Always try to fade out speed bar
1220 if (!isUpdatingSpeed) {
1221 speedBarOpacity -= lag / 30; // half a second
1222 if (speedBarOpacity < 0) {
1223 speedBarOpacity = 0;
1224 }
1225 }
1226
1227 // auto launch shells
1228 if (store.state.config.autoLaunch) {
1229 autoLaunchTime -= timeStep;
1230 if (autoLaunchTime <= 0) {
1231 autoLaunchTime = startSequence() * 1.25;
1232 }
1233 }
1234}
1235
1236//帧绘制回调
1237function update(frameTime, lag) {

Callers 1

updateFunction · 0.85

Calls 1

startSequenceFunction · 0.85

Tested by

no test coverage detected