fix syntax

This commit is contained in:
2026-02-17 09:15:15 -06:00
parent f310c18b84
commit 4e1b63fd0e
52 changed files with 2169 additions and 1754 deletions

View File

@@ -14,11 +14,12 @@ function make_engine(default_clock) {
this.tweens = filter(this.tweens, t => t != tween)
},
update(current_time) {
if (current_time == null) {
current_time = this.default_clock ? this.default_clock() : time.number()
var ct = current_time
if (ct == null) {
ct = this.default_clock ? this.default_clock() : time.number()
}
arrfor(this.tweens, function(tween) {
tween._update(current_time)
tween._update(ct)
})
},
clear() {
@@ -47,7 +48,7 @@ var TweenProto = {
if (is_object(value)) {
arrfor(array(value), subkey => {
var flatKey = key + '.' + subkey
this.startVals[flatKey] = this.obj[key] ? this.obj[key][subkey] : undefined
this.startVals[flatKey] = this.obj[key] ? this.obj[key][subkey] : null
this.endVals[flatKey] = value[subkey]
})
} else {
@@ -87,7 +88,7 @@ var TweenProto = {
_update: function(now) {
this.seek(now)
this.onUpdateCallback?.()
if (this.onUpdateCallback) this.onUpdateCallback()
},
seek: function(global_time) {
@@ -99,11 +100,14 @@ var TweenProto = {
var start = this.startVals[key]
var end = this.endVals[key]
var value = start + (end - start) * eased
var parts = null
var objKey = null
var subKey = null
if (search(key, '.') != null) {
var parts = array(key, '.')
var objKey = parts[0]
var subKey = parts[1]
parts = array(key, '.')
objKey = parts[0]
subKey = parts[1]
if (!this.obj[objKey]) {
this.obj[objKey] = {}