Quote: "I hate psuedo-code (I can't fill in the stuff you leave out very well), but thanks David, I'll try it."
Pseudo-code presents ideas on how to do things, not simple templates for people to fill in.
It's a good exercise to try and code something yourself from an idea. It gest you thinking: "well how do I do that? in what way could I acheive this?" instead of just recieving heaps of someone else's code ready for you to slot into your game.
Plus, my bullet code is too heavily integrated into my game. BUt is you really want it, here it is:
PrepareBullets:
rem Max bullet life
MaxLife = 50
MaxFlackLife = 25
MaxNumOfBullets=500
MaxNumOfEnemBullets=10
Dim Bullets(maxnumofbullets,2)
Dim EnemBullets(1000,maxnumofbullets,2)
Dim LastCreated(1000)
BulletWait = 100 : `Number of milliseconds between each bullet (0 for no limit)
load object "player/laser.x",4999
ghost object on 4999
hide object 4999
Basebullet = 4999
bullet = 40000
return
DoBullets:
rem Loop through each bullet "slot"
for b = 1 to MaxNumOfBullets
visible = b+10000
o = visible
rem Fire Laser
if Shooting = 1 and Bullets(b,1)=0 and (timer()-LastCreated) > BulletWait
clone object Basebullet,visible
scale object visible,100,100,300
ghost object on visible
set object collision to polygons o
position object o,object position x(player),object position y(player),object position z(player)
yrotate object o,object angle y(player)
Bullets(b,1)=1
Bullets(b,2)=0
move object o,5
rem Store time when bullet was last created, to allow a few secs between each create
LastCreated = timer()
endif
rem If fired, move
if Bullets(b,1)=1
if object exist(o) then move object o,30
`DBP bug - cannot increment / decrement arrays
l = bullets(b,2)
inc l
for ob = 100 to NumEnems+100
if object collision(ob,o)=1 and DeadEnems(ob-100)=0 and object visible(o)=1
l = maxlife
hide object ob
focusobj = ob
yrotate object ob,object angle y(ob)+180
fix object pivot o
randomize timer()
yrotate object ob,rnd(90)-45
xrotate object ob,(rnd(180)/2)-45
DeadEnems(ob-100)=timer()
randomize timer()*o
s = rnd(3)+1
play sound s
inc score,15
endif
`text object screen x(ob),object screen y(ob),str$(dist3d_obj(ob,o))
next ob
rem Collision with space sphere
if Dist3D_obj(o,1) > 3000 then l = maxlife + 1
rem Store life
Bullets(b,2) = l
endif
rem Stop if at end of life and decrement bullets
if Bullets(b,2) > maxlife
Bullets(b,1)=0
if object exist(o) then delete object o
endif
next b
return
function Dist3D_Obj(o,o1)
x1# = object position x(o)
y1# = object position y(o)
z1# = object position z(o)
x2# = object position x(o1)
y2# = object position y(o1)
z2# = object position z(o1)
Distance#=SQRT(((x1#-x2#)*(x1#-x2#))+((y1#-y2#)*(y1#-y2#))+((z1#-z2#)*(z1#-z2#)))
endfunction Distance#
You are the

th person to view this signature.
Programmers don't die, they just
Gosub without
return....