The reason why you cant move once you shoot is because of
Quote: "do
get image 2, 200,25,220,35
sprite 2,bulletx,bullety,2
bulletx = bulletx + 6
if bulletx > screentogo then delete sprite 2
if bulletx > screentogo then goto main
loop"
This invertly creates a loop which will not exit until the bullet reaches the screen width. What you can do however is rather than having the three sub routine, have one big DO LOOP and then instead of
gosub lost you can put
lost = 1
if lost = 1
shipx = 1
shipy = 1
lost = 0
endif
Or in otherwords:
sync on
set display mode 800,600,16
load bitmap "space.bmp",0
load bitmap "ship.bmp",1
shipx# = 1
shipy# = 1
get image 1,0,0,50,75
do
sprite 1,shipx,shipy,1
if rightkey() = 1 then shipx = shipx + 8
if leftkey() = 1 then shipx = shipx - 8
if upkey() = 1 then shipy = shipy - 7
if downkey() = 1 then shipy = shipy + 7
if returnkey() = 1 then gosub quit
if shiftkey() = 1 then lost = 1
if spacekey() = 1 then shoot = 1
if lost = 1
shipx = 1
shipy = 1
lost = 0
endif
if shoot = 1
bulletx = shipx
bullety = shipy
screenlength = 1024
screentogo = screenlength - shipx
get image 2, 200,25,220,35
sprite 2,bulletx,bullety,2
bulletx = bulletx + 6
if bulletx > screentogo then delete sprite 2
if bulletx > screentogo then shoot = 0
endif
sync
loop
quit:
end
I have however kept quit as a gosub. This is because you don't need to return or have any loops when you quit...
Oh and I havent tested my code so if it doesnt work and you cant figure out why, just slap me.... (ouch, not that hard)
James
Hello!