Posted: 16th Jun 2023 18:44
This is a very novice level example of updating elements within a program consistently using the timer instead of relying on a steady sync rate, which everyone knows can suddenly drop.
The 'TimeGap' variable, as well as the object's speed, should be experimented with to optimize event scheduling and desired movement.

+ Code Snippet
make object cube 1,1:set object wireframe 1,1
make object sphere 2,1:turn object left 2,40
SyncRate=60:sync on:sync rate SyncRate
oldTimer#=abs(timer())
do
increment#=abs(timer())-oldTimer#
inc TimeCount#,increment#
TimeGap=int(TimeCount#*.1)
if TimeGap>0
for m=1 to TimeGap
move object 2,.001
next
TimeCount#=0
endif
oldTimer#=abs(timer())
if lower$(inkey$())="r" then position object 2,0,0,0
if inkey$()="+" then inc SyncRate
if inkey$()="-" then dec SyncRate:if SyncRate<20 then SyncRate=20
if OldSync<>SyncRate then sync rate SyncRate:OldSync=SyncRate
set cursor 0,0
print "Press 'R' to reset object"
print "Press (+) or (-) to change the sync rate"
print
print "SyncRate: ";SyncRate
print "Screen FPS: ";screen fps()
sync
loop
Posted: 12th Jul 2023 1:50
Much to my amazement, I pasted the above code into Google's new AI bot (bard.google.com) and this is what it returned:

This code first creates two objects, a cube and a sphere. The cube is set to wireframe mode, and the sphere is rotated 40 degrees to the left. The code then sets the sync rate to 60 frames per second and starts a loop.

Inside the loop, the code first calculates the time elapsed since the previous frame. Then, it increments a variable TimeCount by the amount of time elapsed. The code then calculates the number of frames that should have been rendered in the time elapsed. If the number of frames is greater than zero, the code moves the sphere by a small amount.

The code then checks for user input. If the user presses the R key, the sphere is reset to its original position. If the user presses the + or - key, the sync rate is increased or decreased by one. If the sync rate is changed, the code syncs the screen to the new rate.

Finally, the code prints some status information to the screen, including the sync rate and the screen's frames per second. The loop then repeats.

I hope this helps!