feat: added added new skin to ptilopsis

well, i have to make changes to spine-ts so it can handle the difference between the size of texture
This commit is contained in:
Haoyu Xu
2025-05-02 21:38:09 +08:00
parent 093f9d7f1a
commit 0af19cf652
385 changed files with 12361 additions and 121068 deletions

View File

@@ -349,29 +349,35 @@ module spine {
}
export class TimeKeeper {
maxDelta = 0.064;
framesPerSecond = 0;
delta = 0;
totalTime = 0;
framesPerSecond = 0
delta = 0
totalTime = 0
private lastTime = Date.now() / 1000;
private frameCount = 0;
private frameTime = 0;
private lastTime = performance.now() / 1000
private frameCount = 0
private frameTime = 0
private fpsInterval = 1 / 60
update () {
let now = Date.now() / 1000;
this.delta = now - this.lastTime;
this.frameTime += this.delta;
this.totalTime += this.delta;
if (this.delta > this.maxDelta) this.delta = this.maxDelta;
this.lastTime = now;
update() {
const now = performance.now() / 1000
this.delta = now - this.lastTime
if (this.delta > this.fpsInterval) {
this.frameTime += this.delta
this.totalTime += this.delta
this.lastTime = now
this.frameCount++;
if (this.frameTime > 1) {
this.framesPerSecond = this.frameCount / this.frameTime;
this.frameTime = 0;
this.frameCount = 0;
}
this.frameCount++
if (this.frameTime > 1) {
this.framesPerSecond = this.frameCount / this.frameTime
this.frameTime = 0
this.frameCount = 0
}
} else {
this.delta = -1
}
}
setFps(v: number) {
this.fpsInterval = 1 / v
}
}