can anyone tell me why when you shoot a lot, the program ends?
to move use the mouse, and to shoot left click
REM Project: sprite
REM Created: 06/11/2005 20:07:52
REM
REM ***** Main Source File *****
REM
hide mouse
unit$="commander"
bullet=30
load image "grey.jpg",1
rem enemys
sprite 5, 20,0,1
sprite 6, 120,0,1
sprite 7, 240,0,1
sprite 8, 360,0,1
sprite 9, 490,0,1
scale sprite 5,5
scale sprite 6,5
scale sprite 7,5
scale sprite 8,5
scale sprite 9,5
sprite 2,200,200,1
scale sprite 2,5
sprite 1,200,200,1
scale sprite 1,5
do
if mouseclick()=0
gosub movement
endif
if mouseclick()=1
gosub shoot
wait 250
endif
if sprite exist(bullet)
if sprite y(bullet)>0
gosub shooting
endif
endif
if sprite exist(bullet-1)
if sprite y(bullet-1)>0
gosub shooting1
endif
endif
if sprite exist(bullet-2)
if sprite y(bullet-2)>0
gosub shooting2
endif
endif
if sprite exist(bullet-3)
if sprite y(bullet-3)>0
gosub shooting3
endif
endif
if sprite exist(bullet-4)
if sprite y(bullet-4)>0
gosub shooting4
endif
endif
if sprite exist(bullet-5)
if sprite y(bullet-5)>0
gosub shooting5
endif
endif
if sprite exist(bullet-6)
if sprite y(bullet-6)>0
gosub shooting6
endif
endif
if sprite exist(bullet-7)
if sprite y(bullet-7)>0
gosub shooting7
endif
endif
if sprite exist(bullet-8)
if sprite y(bullet-8)>0
gosub shooting8
endif
endif
if sprite exist(bullet-9)
if sprite y(bullet-9)>0
gosub shooting9
endif
endif
if sprite exist(bullet-10)
if sprite y(bullet-10)>0
gosub shooting10
endif
endif
remstart
if sprite exist(bullet)
if sprite hit(bullet,1)
delete sprite 1
endif
endif
remend
if sprite exist(bullet)
dead=sprite hit(bullet,0)
if dead>1
delete sprite dead
endif
endif
if sprite exist(bullet-1)
dead=sprite hit(bullet-1,0)
if dead>1
delete sprite dead
endif
endif
if sprite exist(bullet-2)
dead=sprite hit(bullet-2,0)
if dead>1
delete sprite dead
endif
endif
if sprite exist(bullet-3)
dead=sprite hit(bullet-3,0)
if dead>1
delete sprite dead
endif
endif
if sprite exist(bullet-4)
dead=sprite hit(bullet-4,0)
if dead>1
delete sprite dead
endif
endif
if sprite exist(bullet-5)
dead=sprite hit(bullet-5,0)
if dead>1
delete sprite dead
endif
endif
if sprite exist(bullet-6)
dead=sprite hit(bullet-6,0)
if dead>1
delete sprite dead
endif
endif
if sprite exist(bullet-7)
dead=sprite hit(bullet-7,0)
if dead>1
delete sprite dead
endif
endif
if sprite exist(bullet-8)
dead=sprite hit(bullet-8,0)
if dead>1
delete sprite dead
endif
endif
if sprite exist(bullet-9)
dead=sprite hit(bullet-9,0)
if dead>1
delete sprite dead
endif
endif
if sprite exist(bullet-10)
dead=sprite hit(bullet-10,0)
if dead>1
delete sprite dead
endif
endif
rem this is so that when the bullet reaches the end, it dissapears
if sprite exist (bullet)
if sprite y(bullet)=0
delete sprite bullet
endif
endif
if sprite exist (bullet-1)
if sprite y(bullet-1)=0
delete sprite bullet-1
endif
endif
loop
if sprite exist (bullet-2)
if sprite y(bullet-2)=0
delete sprite bullet-2
endif
endif
if sprite exist (bullet-3)
if sprite y(bullet-3)=0
delete sprite bullet-3
endif
endif
if sprite exist (bullet-3)
if sprite y(bullet-3)=0
delete sprite bullet-3
endif
endif
if sprite exist (bullet-4)
if sprite y(bullet-4)=0
delete sprite bullet-4
endif
endif
if sprite exist (bullet-5)
if sprite y(bullet-5)=0
delete sprite bullet-5
endif
endif
if sprite exist (bullet-6)
if sprite y(bullet-6)=0
delete sprite bullet-6
endif
endif
if sprite exist (bullet-7)
if sprite y(bullet-7)=0
delete sprite bullet-7
endif
endif
if sprite exist (bullet-8)
if sprite y(bullet-8)=0
delete sprite bullet-8
endif
endif
if sprite exist (bullet-9)
if sprite y(bullet-9)=0
delete sprite bullet-9
endif
endif
if sprite exist (bullet-10)
if sprite y(bullet-10)=0
delete sprite bullet-10
endif
endif
movement:
if unit$="commander"
posx#=mousex()
posy#=mousey()
sprite 1,posx#,posy#,1
rem print "half way"
scale sprite 1,5
remstart
rotate sprite 1,posy#-posx#
print "rotated"
move sprite 1,1
remend
endif
return
shoot:
inc bullet,1
sprite bullet,posx#,posy#,1
scale sprite bullet,1
move sprite bullet,1
return
rem all the shootings
shooting:
move sprite bullet,1
return
shooting1:
move sprite bullet-1,1
return
shooting2:
move sprite bullet-2,1
return
shooting3:
shooting4:
shooting5:
shooting6:
shooting7:
shooting8:
shooting9:
shooting10: