Add navigation components 131-150; pixel Pad, Finish, Park, Since

This commit is contained in:
ZacharyZhang-NY committed 2026-10-11 21:27:09 -04:00
1 parent bd3877e1b1
commit f587d25a5a
63 files changed
+2776 -87

No files matched your search

+12
View File
@@ -55,6 +55,18 @@ func (k Kit) Tick(c *ui.Context, fps int) int {
return n
}
// Since counts steps from t at fps, up to done.
func (k Kit) Since(c *ui.Context, t time.Time, fps, done int) int {
if t.IsZero() {
return done
}
n := int(k.now.Sub(t) * time.Duration(fps) / time.Second)
if n < done {
k.Tick(c, fps)
}
return min(n, done)
}
// frameAt is the frame at t and the next wait.
func frameAt(t time.Time, fps int) (int, time.Duration) {
checkFPS(fps)