So my bullets delete at collision, about 90 percent of the time, I guess it is just me or my code.
Here is my collision and delete code, I need help on this one.
For x = 0 to All_Enemy.Length
For Bull = 0 to shot.Length
if GetSpriteExists(shot[Bull].ID)=1
shot[Bull].LifeTime= shot[Bull].LifeTime+1
if shot[Bull].LifeTime=>30
SetSpritePhysicsOff(shot[Bull].ID)
DeleteSprite ( shot[Bull].ID )
DeleteSprite ( explodeid )
endif
BX# = GetSpriteXByOffset(shot[Bull].ID) : BY# = GetSpriteYByOffset(shot[Bull].ID)
createclone=1
if createclone=1 then explodeid=CloneSprite(explode)
createclone=0
SetSpritePositionByOffset(explodeid,BX#,BY#)
if GetPhysicsCollision(shot[Bull].ID,All_Enemy[x].enemyID)=1 then SetSpriteVisible(shot[Bull].ID,0)
if GetPhysicsCollision(shot[Bull].ID,All_Enemy[x].enemyID)=1
EX# = GetSpriteXByOffset(All_Enemy[x].enemyID) : EY# = GetSpriteYByOffset(All_Enemy[x].enemyID)
SetSpriteVisible(explodeid,1)
PlaySprite(explodeid,10,0,1,8)
SetSpritePosition(All_Enemy[x].enemyID,EX#+300,20)
SpawnCoin(All_Enemy[x].enemyID)
inc Coins,1
DeleteSprite ( shot[Bull].ID )
playsound(sound_1)
//endif
endif
endif
explodeidframe=GetSpriteCurrentFrame(explodeid)
if explodeidframe>7 then SetSpriteFrame( explodeid,7 )
if explodeidframe=7 then DeleteSprite ( explodeid )
next Bull
next x