LoginLogin

WAIT Battle Royale (2020)

Root / Submissions / [.]

12Me21Created:
Everything you knew about WAIT was a lie. First, this will be a helpful function:
DEF DELAY SEC
 VAR M=MILLISEC+SEC*1000
 WHILE MILLISEC<M:WEND
END
(change MILLISEC to MILLISEC() in SB4) In the past, we assumed WAIT n would always wait n frames However, this isn't true and somehow no one noticed(!!!) WAIT n waits for n frame boundaries to happen, And this means it actually waits for between N-1 and N frames, depending on when it starts. For example, if we start waiting halfway through a frame:
VSYNC
VSYNC

DELAY 1/60 /2 'wait half a frame
S = MILLISEC
WAIT 1
?MILLISEC-S
You might expect this to print 16 or 17 (the number of milliseconds in a frame), but it actually only prints between 7 and 9!

No posts yet (will you be the first?)