Minor changes to EffectMaker

This commit is contained in:
loplkc loplkc 2022-02-11 20:27:30 -05:00
parent b1a1bb6013
commit f48eff5f67

View file

@ -57,12 +57,13 @@ class effectHandler implements effectMaker, effectRunner {
}
particleEffect() {}
runEffects(timeSinceLastFrame: number) {
let effectsToRun = this.effectsToRun
let effectsToRun = this.effectsToRun;
print(tostring(effectsToRun.size()) + " effects to run.");
for (const effect of effectsToRun) {
// Update the effect time
let timeSinceLastKeypoint = effect[0] + timeSinceLastFrame;
let nextKeypoint = effect[1][1];
let timeOfNextKeypoint = nextKeypoint[0];
let timeSinceLastKeypoint = effect[0] + timeSinceLastFrame;
while (timeSinceLastKeypoint >= timeOfNextKeypoint) {
if (effect[1][2]) {
timeSinceLastKeypoint -= timeOfNextKeypoint;
@ -70,13 +71,12 @@ class effectHandler implements effectMaker, effectRunner {
nextKeypoint = effect[1][1];
timeOfNextKeypoint = nextKeypoint[0];
} else {
effect[2].Destroy()
effectsToRun.remove(0)
continue // Move on if this effect is done
effect[2].Destroy();
effectsToRun.remove(0);
continue; // Move on if this effect is done
}
}
effect[0] = timeSinceLastKeypoint;
// Get the rest of the variables
const currentKeypoint = effect[1][0];
const easingStyle = currentKeypoint[5];
const meshPart = effect[2];