(timeStep, lag)
| 1214 | |
| 1215 | // Extracted function to keep `update()` optimized |
| 1216 | function 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 | //帧绘制回调 |
| 1237 | function update(frameTime, lag) { |
no test coverage detected