heh well iv made some code to get bullets working on my game
its a bit more complex then others but theres just somthing that im missing
sync on
hide mouse
cb=1
mx=21
my=17
mo#=0.375
dim bullets(100)
for x=1 to 100
make object sphere x+4000,0.1
hide object x+4000
bullets(x)=-1
next x
make object triangle 2002,0,0,0,.2,0.2*sqrt(3),0,0.2*2,0,0
zrotate object 2002,60
position object 2002,2,3,0
`position var.
c#=mx*mo#/2+.25
d#=my*mo#/2+.25
position camera c#,d#,-10
point camera c#,d#,0
do
`controls
msx#=msx# + (mousemovex()*0.018)
msy#=msy# - (mousemovey()*0.018)
if spacekey()=1 then gosub gntype
if spacekey() = 0 then gntpctrl = 0
if mouseclick()=1 then gosub shoot
if mouseclick()=0 then pisshot = 0
`misc
if guntype = 4 then guntype = 1
if guntype=1 then gunname$="Pistol" else if guntype=2 then gunname$="Uzi" else if guntype=3 then gunname$="M16"
set cursor 5,5
print "X: " ; int(ppx#/4) ; " Y: " ; int(ppy#/4) ; " Gun: " ; gunname$ ; " BND= " ; bnd ; " CB= " ; cb ; " BN= " ; bn
position object 2002,msx#,msy#,0
sync
loop
`SUB's**
`***
SHOOT:
if guntype = 1 and pisshot = 0 then pisshot = 1 : gosub pistol
if guntype = 2 then gosub uzi
if guntype = 3 then gosub m16
return
`***
gntype:
if gntpctrl = 0 then guntype = guntype + 1 : gntpctrl = 1
if guntype = 4 then guntype = 1
return
`***
pistol:
do
bdchk = 1
gosub bulletnumber
if bdchk=0
position object cb+4000,c#,d#,.1
point object cb+4000,msex#,msey#,.1
show object cb+4000
cb=cb+1
bullets(cb)=100
return
endif
loop
uzi:
return
m16:
return
`***
bulletnumber:
bdchk=0
`for n=1 to 100
if bullets(cb)=-1
return
else
cb=cb+1
if cb = 101 then cb=1
bdchk=1
endif
return
`***
bulletdie:
hide object x+4000
bullets(x)=-1
position object x+4000,0,0,0
return
`***
bulletrun:
for x=1 to 100
if bullets(x)<> 0 and bullets(x) <> -1 then bullets(x)=bullets(x)-1 : move object (4000+x) , 0.1
if bullets(x)=0 then bnd=x : gosub bulletdie:
next x
return
i think iv stuffed up a logic statment or somthing liek instead of move bullets when there alive i move them when there dead thus they dont move, but i cant see it