v3.1.1: various stability improvements for low/inconsistent FPS:

- game now has a max delta time of 200ms
- added some checks to ensure non-looped animations do not complete twice
- adjusted 'enemy' reference in hero to 'attackTarget'
This commit is contained in:
Evan Debenham
2025-06-11 17:27:41 -04:00
parent 9fb18b3b45
commit b6dee52811
8 changed files with 32 additions and 30 deletions

View File

@@ -63,9 +63,11 @@ public class MovieClip extends Image {
while (frameTimer > curAnim.delay) {
frameTimer -= curAnim.delay;
if (curFrame >= curAnim.frames.length - 1) {
curFrame = curAnim.frames.length - 1;
if (curAnim.looped) {
curFrame = 0;
} else {
curFrame = curAnim.frames.length - 1;
frameTimer = 0;
}
finished = true;
if (listener != null) {