What version of dbp do you have installed(in the menu select "about" under "help")? I
think vsync may have been introduced in a later update.
Edit: btw there is a reason for not using fullscreen which I shall explain when you get the previous snippet to work.
Edit2: Actually I`ll explain now as I`m about to goto bed, didn`t realise it was so late.
You will note that graphically the ship sprite is now flickering. In my graphics card settings if I set the quality to performance, no matter what code I put in fullscreen exclusive mode is awful with controlling the framerate smoothly, even timer based movement does not help much. However, if the graphics quality settings are on quality as opposed to performance, then its not an issue anymore. Now this could just be my card(nvidia 8800GT), so run the following code twice, once with your graphics settings on best quality and once on lowest quality and see if there is a difference in the behaviour of the refresh rate.
REM Project: BulletShot
REM Created: 5/11/2009 1:34:26 PM
REM
REM ***** Main Source File *****
REM
rem Project Goal: Learn how to create and fire bullets from a sprite!
rem Secondary Project Goal: Learn how to make a scrolling space background.
rem (this will set the display mode. If the mode is not available then
rem the program will exit)
If Check Display Mode(800, 600, 16) > 0
Exit
EndIf
set display mode 800, 600, 16, 1
set window off
backdrop Off
Sync On
sync rate 60
rem (sets the transparent color for sprites)
set image colorkey 255, 0, 255
rem (loads backdrop and background sprite into memory)
Load Image "bdrop.bmp", 1,1
Load Image "star1.bmp", 2,1
Load Image "ship.bmp", 3,1
rem (this is the position of the star object)
StarX = 200
StarY = 0
Speed = 1
rem (this is the starting position and speed of the ship object)
LocX = 400
LocY = 500
ShipSpeed = 3
Do
rem (this will paste the background onto the main screen)
sprite 1, 0, 0, 1
rem (this increment the Y value of the star object and move down the screen
rem at a set rate. The transparent color will not be drawn.)
Inc StarY, Speed
rem (this will reset the star's position if it hits the bottom of the screen)
If StarY = 600
StarY = 0
EndIf
rem this will handle the input commands from the keyboard as well as
rem check for collisions with the screen edge
If LocY > 0 AND (upkey() > 0 OR joystick up() > 0)
Dec LocY, ShipSpeed
endif
If (LocY + 80) <= 600 AND (downkey() > 0 OR joystick down() > 0)
Inc LocY, ShipSpeed
endif
If LocX > 0 AND (leftkey() > 0 OR joystick left() > 0)
Dec LocX, ShipSpeed
endif
if (LocX + 60) <= 800 AND (rightkey() > 0 OR joystick right() > 0)
inc LocX, ShipSpeed
endif
rem (pastes images in order)
sprite 2, StarX, StarY, 2
sprite 3, LocX, LocY, 3
`unlock pixels
rem (exits the program when the space key is pressed)
If spacekey() > 0
Exit
Endif
sync
Loop
end
Edit3: You can rem out any of the lines 15 - 19 and test under the same conditions re graphics card performance/quality settings() and the use of fullscreen exlusive mode setting in the project(on the left panel in the new editor, on the right panel in old editor).
If I have this right you should find some really odd behaviour in some cases of the tests.