Hi all
I'm getting the above error in my shoot 'em up type project that I've been working on for a few day, and it's driving me to distraction.
I have a #constant, lasersnd, set up loaded with a wav file "laser.wav" from one of the example projects.
#constant lasersnd=LoadSound("laser.wav")
This is passed to a "create bullet" function, when the fire button is pressed and a 'bullet' fired. Works great until somewhere around 220 - 260 bullets have been fired, then the game crashes with the error in the title.
createshot(lasersnd,1,player.x,player.y-20,player.x,player.y-500,laserspd,laser,laserimg)
function createshot(sound,p,x#,y#,dx#,dy#,spd,weapon,image)
inc numshots
if p=1 then inc shotsfired
tempshot as shot
tempshot.sp=CreateSprite(image)
tempshot.image=image
tempshot.x=x#
tempshot.y=y#
tempshot.dx=getmovex(x#,y#,dx#,dy#,spd)
tempshot.dy=getmovey(x#,y#,dx#,dy#,spd)
tempshot.speed=spd
tempshot.exists=1
tempshot.weapon=weapon
tempshot.damage=1
tempshot.playershot=p
projectiles.insert(tempshot)
if sound>0 then playsound(sound)
endfunction
The help states that the sound instance is deleted when the sound has finished playing, so I am at a loss as to why it would appear to be running out of IDs. Should I be deleting/cleaning up sounds somewhere?
The only other sound in the game is an explosion sound, which also suffered from the same error but only once and has never done it again.
Any advice would be much appreciated.