Sorry but I don't have time to code it right now for you, but this may help you get going...
I believe you are going to need to replace the
input command with either
inkey$() for a character response, or for reading strings, Entry$(). You can always convert the string data to numerical form with the
VAL command.
Note. You can clear the string in the windows message pump, read by Entry$() with the Clear Entry Buffer command.
Although I haven't tested it out, I believe the
Input command will halt execution of the rest of your
program logic until the enter key is pressed.
-----
As for time...
You will want to look into the the
timer command.
Then sete your internal
dec time#to be synced with real time. Right now, your code is dependent on syncrate and on delay/wait commands in your loop. That's not going to work.
Keep in mind that
return integer=TIMER() retruns time in milleseconds. Thus, 1000 is equal to 1 second. So, if you divided the result by 1000 you would have seconds.
The returned integer is also the internal system time, so you would need to get the system time at the start of the "start of the countdown", and then check how much time has passed each iteration of (pass through) the loop. In this manner the dec time# should only execute if timepassed is => then 1 second
here's some pseudo(fake) code to help.
time1=timer()
time2=timer()
timepassed=(time2-time1)/1000
if timepassed >= 1
dec time#, 1
endif
I hope this makes sense, my head is kind of spinning from work. I can throw up some code later, but this will get you going in the right direction.
Heres an example template of using the timer command to control the game loop rate...
backdrop off
hide mouse
sync on
sync rate 0
set image colorkey 255,0,255
`*** Set the screen size/depth
`#### THIS WOULD BE SECTION 1: INITIALIZATION #####
`(as weel as the function definitions after the loop
`*** Initializtion code (define globals, dim arrays, load media, etc)
`-------------------------------------------------------------------------------------------
`- -
`- M_A_I_N L_O_O_P S T A R T -
`- -
`-------------------------------------------------------------------------------------------
`#### PREPERATION FOR SECTION 6: HOLD FRAME RATE #####
movetimerset# = 1000/10
movetimer# = timer()
`#### THIS IS SECTION 2: ENTERING THE GAME LOOP #####
do
cls
`#### THE OUTER CONDITION OF PART 6: HOLD THE FRAME RATE ####
if timer() - movetimer# > movetimerset#
`#### REM THIS IS SECTION 3: RETRIEVE PLAYER INPUT ####
`*** Call input handler
if escapekey()=1
`*** Cleanup any resources in use
endif
`#### THIS IS SECTION 4: PERFORM AI and GAME LOGIC ####
`*** Game logic (AI, Collision, Calcualtions, physics)
`#### THIS IS SECTION 5: RENDER THE NEXT FRAME ####
`*** Prepare for the next animation frame
`#### THIS IS SECTION 6: SYNCHRONIZE DISPALY #####
`*** Draw Images/sprites to screen
`*** Make sync call
`#### PART OF SECTION 6: TO HOLD FPS ####
movetimer# = timer()
endif
sync
`#### THIS IS SECTION 7: LOOP #####
loop
`-------------------------------------------------------------------------------------------
`- -
`- E N D O F M_A_I_N G_A_M_E L_O_O_P -
`- -
`--------------------------------------------------------------------------------------------
`#### THIS IS WHERE WE WOULD HAVE SECTION 8: SHUTDOWN ####
`*** Declare & define Functions
`#### THIS IS ALSO PART OF SECTION 1 ####