G'Day,
I have assembled a small sprite movement example here (with latest patched DBP version) but I have some problems with it:
sync on: sync rate 0: hide mouse
set display mode 640, 480, 16
set image colorkey 0, 0, 0
load image ".\background.bmp", 1, 1
paste image 1, 0, 0, 1: sync
load image ".\up.bmp", 2, 1
load image ".\down.bmp", 3, 1
load image ".\left.bmp", 4, 1
load image ".\right.bmp", 5, 1
set sprite 2, 1, 1
set sprite 3, 1, 1
set sprite 4, 1, 1
set sprite 5, 1, 1
position_x = 30
position_y = 30
sprite_drawing = 5
do
sprite 1, position_x, position_y, sprite_drawing
if upkey() = 1 then position_y = position_y - 5: sprite_drawing = 2
if downkey() = 1 then position_y = position_y + 5: sprite_drawing = 3
if leftkey() = 1 then position_x = position_x - 5: sprite_drawing = 4
if rightkey() = 1 then position_x = position_x + 5: sprite_drawing = 5
ink rgb(0,0,0),0
box 565,440,625,458
ink rgb(255,255,0),0
text 20,screen height()-40,desc$
fps$="FPS: "+str$(screen fps())
text screen width()-20-text width(fps$),screen height()-40,fps$
sync
loop
If you try this example, it runs very slowly giving a frame rate around 10 fps.
If I change the "backsave" feature to the following in these lines, the example runs very smoothly and fast on all our test computers:
set sprite 2, 0, 1
set sprite 3, 0, 1
set sprite 4, 0, 1
set sprite 5, 0, 1
But this leaves a trail from our sprite.
What can I do to avoid this since it seems that the "backsave" feature is bugged?
I am not interested in clearing the screen after each sync and repaste the background.
All our test computers live up to the minimum requirements to run DBP if not better.
Thank you in advance!