here you go, I rewrote it, One section is remmed out, but it is working now.
AutoCam Off
Type Bullets
Life as integer
Obj As Integer
EndType
dim Bull(0) as Bullets
make object cube 1,3
Do
Control Camera Using ArrowKeys 0,2,2
If SpaceKey() = 1 Then FireBullet(1,0,100)
UpdateBullets()
Loop
function FireBullet(obj,limb,life)
` Create a New Bullet, (Simple Object Cube)
n = Array Count(Bull())
Add To Stack Bull()
Bull(n).Obj = Find Free Object()
Bull(n).Life = Life
Make Object Cube Bull(n).Obj,1
x# = limb position x(obj,limb)
y# = limb position y(obj,limb)
z# = limb position z(obj,limb)
ax# = object angle x(obj)
ay# = object angle y(obj)
az# = object angle z(obj)
position object Bull(n).Obj,x#,y#,z#
rotate object Bull(n).Obj,ax#,ay#,az#
endfunction
function UpdateBullets()
` Update Existing Bullets
For n = 0 to Array Count(Bull())-1
If Bull(n).Obj > 0 : move object Bull(n).Obj,1 : Bull(n).life = Bull(n).life-1
If Bull(n).Life <= 0 Then delete object Bull(n).Obj : Bull(n).Obj = 0
EndIf : Next n
` See if any Dim Spaces can be removed, (Frees Memory if Dim can be kept small)
` If Array Count(Bull()) > 1
` If Bull(1).Obj = 0 Then Remove From Stack Bull()
` EndIf
endfunction
Id suggest keeping dim sizes down and low object numbers if possable, as this will help speed up your game, I assume Limb is so it fires from a hand or gun mobel, i used Limb 0 as this is the Root Limb, which every object has, Theres no collision in this code, but you can fire as many bullets as you wish.