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:
@@ -1,35 +0,0 @@
|
||||
/**
|
||||
* Adapted from 'spine-ts/core/src/Utils.ts'
|
||||
*/
|
||||
export class TimeKeeper {
|
||||
framesPerSecond = 0
|
||||
delta = 0
|
||||
totalTime = 0
|
||||
|
||||
private lastTime = performance.now() / 1000
|
||||
private frameCount = 0
|
||||
private frameTime = 0
|
||||
private fpsInterval = 1 / 60
|
||||
|
||||
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
|
||||
}
|
||||
} else {
|
||||
this.delta = -1
|
||||
}
|
||||
}
|
||||
setFps(v: number) {
|
||||
this.fpsInterval = 1 / v
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
import { spine } from '../spine-ts/build/spine-webgl.js'
|
||||
import { TimeKeeper } from './libs/TimeKeeper.ts'
|
||||
import spine from '../build/spine-webgl.js'
|
||||
|
||||
/**
|
||||
* Adapted from 'spine-ts/player/src/Player.ts'
|
||||
@@ -105,7 +104,7 @@ export class Player {
|
||||
|
||||
private paused = false
|
||||
private playTime = 0
|
||||
private time = new TimeKeeper()
|
||||
private time = new spine.TimeKeeper()
|
||||
private currentViewport!: Viewport
|
||||
private previousViewport!: Viewport
|
||||
private viewportTransitionStart = 0
|
||||
|
||||
Reference in New Issue
Block a user