There is no use in this situation, that's what we've been trying to tell you...
Please study this example:
A much better way to do it would be like this:
Another problem you'll run into if you want to use the keyboard buffer to automate the demo, is that the user can still press keys on the keyboard, and they'll still get put in the buffer along with all your data.
Please study this example:
If DemoMode = True Command$ = ReadCommandFromFile() ;Get the next command PushKeyboardBuffer( Command$ ) ;Put data into the keyboard buffer Endif If KeyDown( KEY_UP ) Player\Y = Player\Y -1 Endif ...
A much better way to do it would be like this:
If DemoMode = True Command$ = ReadCommandFromFile() ;Get the next command. Select Command$ Case "KEY_UP" : PlayerMoveUp() ;Interpret command. ... End Select else If KeyDown( KEY_UP ) PlayerMoveUp() ;interpret command. Endif ... endif Function PlayerMoveUp() Player\Y = Player\Y -1 End Function ...
Another problem you'll run into if you want to use the keyboard buffer to automate the demo, is that the user can still press keys on the keyboard, and they'll still get put in the buffer along with all your data.