This is my entire do loop that the code is located in. At the beginning the code is for my scrolling background, then my scoring and life text and then its the code from above. As you can see, it has the sync of it.
do
rem if rightkey()=1
set current bitmap 2
offset= offset+1
for i = 1 to 640
paste image x(i+offset),i,0
next i
rem endif
set current bitmap 0
copy bitmap 2,0
rem Lifes left text on the screen
set text size 10
ink rgb(255,255,255),0
text 10,465,"Lifes Left:"
rem Score text on the screen
set text size 10
ink rgb(255,255,255),0
text 10,15,"Score:"
if upkey()=1 then ypos=ypos-5
if downkey()=1 then ypos=ypos+5
rem Update sprite
sprite 1,xpos,ypos,1
spriteposition_x = sprite x(1)
spriteposition_y = sprite y(1)
`39 because my spaceship is 90x37 pixels
if spriteposition_y < 0
spriteposition_y = 0
endif
if spriteposition_y > 443
spriteposition_y = 443
endif
`1 is the sprite number and sprite image number is 1 too.
sprite 1,spriteposition_x,spriteposition_y,1
sync
if spacekey()>0
gosub fire
endif
rem Refresh screen now
rem SYNC : SLEEP 20
sprite 5, xalien,yalien,3
xalien=xalien-1
rem if xalien<160
rem delete sprite 5
rem endif
if sprite collision(1,5)>0 then DELETE BITMAP 5
loop
If had a little fiddle around with it, but it's still doing the same - any suggestions?
Thanks, Bankzy10