You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the original code conrtains a funny, non-reproducible, but regular bug!
Here is the original code:
class Totem extends TileSprite {
....
update(dt, t) {
if (math.randOneIn(250)) {
this.fireIn = 1;
}
if (this.fireIn > 0) {
this.fireIn -= dt;
// Telegraph to the player
this.frame.x = [1, 0][((t / 0.1) | 0) % 2];
if (this.fireIn < 0) {
this.fireAtTarget();
}
}
}
}
Now here's what happens form time to time: By sheer coincidence, fireIn might end up exactly as zero after a couple of frames (around 60). In that case, no bullet will be fired (because fireIn < 0 is false) and no further subtraction will occur (because fireIn > 0 is also false). Happens regularly on my mac with Safari ;-)
The text was updated successfully, but these errors were encountered:
Hi Guys
the original code conrtains a funny, non-reproducible, but regular bug!
Here is the original code:
Now here's what happens form time to time: By sheer coincidence, fireIn might end up exactly as zero after a couple of frames (around 60). In that case, no bullet will be fired (because fireIn < 0 is false) and no further subtraction will occur (because fireIn > 0 is also false). Happens regularly on my mac with Safari ;-)
The text was updated successfully, but these errors were encountered: