Files
aego/script/runtime/curve.go
T
sanspie 0fbf22a090 Stage 9.4a: curves, tween, timers
core/curve with presets, keys, wraps; KindCurve in schema, scenes, prefabs and the inspector curve editor.
modules/tween: tweens and timers in per-world pools, game and unscaled domains, script field targets via contracts/scriptfields.
Host handle types (abi.Handle, bind.Handle, manifest v5), yield on awaitable handles via contracts/scriptwait.
Script modules aego/curve, aego/tween, aego/timer; platformer enemy uses a cooldown and a fade-out tween.
Docs: tween.md, curves.md, language reference; golden for the curve editor.
2026-10-18 21:32:39 +03:00

30 lines
554 B
Go

package runtime
import (
"unsafe"
"aego/core/curve"
"aego/schema"
"aego/script/bind"
"aego/script/vm"
)
var _ bind.CurveSource = (*Runtime)(nil)
func (r *Runtime) CurveOf(v vm.Value) (*curve.Curve, error) {
p, fd, err := r.component(vm.Value{A: v.A, B: uint64(uint32(v.B))}, int(v.B>>32))
if err != nil {
return nil, err
}
if fd.Kind != schema.KindCurve {
return nil, errBadComponent
}
return (*curve.Curve)(unsafe.Add(p, fd.Offset)), nil
}
func (r *Runtime) Complete(typ, id uint64) {
if r.co != nil {
r.co.Complete(typ, id)
}
}