Hi, it's me again. I hope I did the right thing by making a separate post for this problem.
Here is my bullet code:
Bullets:
rem Loop through each bullet "slot"
for b = 1 to MaxNumOfBullets
rem Fire Sprite
if mouseclick()=1 and Bullets(b,1)=0 and (timer()-LastCreated) > BulletWait
sprite b+10, playerx#, playery#, 2
rotate sprite b+10,sprite angle(1)
Bullets(b,1)=1
Bullets(b,2)=0
show sprite b+10
move sprite b+10,3
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
move sprite b+10,1
`DBP bug - cannot decrement arrays
l = bullets(b,2)
inc l
Bullets(b,2) = l
endif
rem Stop if at end of life and decrement bullets
if Bullets(b,2) > maxlife
Bullets(b,1)=0
hide sprite b+10
endif
next b
return
(it's actually not mine I siphoned it off of the CodeBase and forgot who to give credit to, please tell me if this is yours!)
Here's my problem: I'm trying to add the function
if sprite collision(??,2) then sprite 3,enemyx#,enemyy#,3
?? = problem, 2 = enemy sprite, enemyx# and enemyy# are enemy position
to my code somewhere in that goSub up there, but I'm unsure what to put in the ?? spot in that string right above. It needs to be the bullet, but I don't know which sprite IS the bullet. If I put 10 I get a "sprite doesn't exist" error, if I put b+10 the bloodsplatter doesn't show up unless I'm standing right next to the enemy.
Please help!
Regards, Alexand3rS.
http://DoLoop.page.tl
http://www.youtube.com/Alexand3rS