whats wrong with this??
Function pinguibullet()
hits = 30
diry = 5
dirx = 5
For pbs.pb = Each pb
while hits > 0
pbs\x = player\x
pbs\y = player\y
pbs\x = pbs\x + dirx
pbs\y = pbs\y + diry
DrawImage (pbimage, player\x,player\y)
If ImagesCollide(pbimage,pbs\x,pbs\y,0,ship\image,ship\x,ship\y,0)
PlaySound jaja
hits = hits - 30
Delete pbs
EndIf
If pbs\y > ImageHeight Or pbs\y < 0
diry = -diry
EndIf
If pbs\x > ImageWidth Or pbs\x < 0
dirx = -dirx
EndIf
hits = hits - 1
wend
Next
End Function
I want it to be able to shoot many bullets, but I cant!! everything else in my code is right , this is inside the main loop.
Function pinguibullet()
hits = 30
diry = 5
dirx = 5
For pbs.pb = Each pb
while hits > 0
pbs\x = player\x
pbs\y = player\y
pbs\x = pbs\x + dirx
pbs\y = pbs\y + diry
DrawImage (pbimage, player\x,player\y)
If ImagesCollide(pbimage,pbs\x,pbs\y,0,ship\image,ship\x,ship\y,0)
PlaySound jaja
hits = hits - 30
Delete pbs
EndIf
If pbs\y > ImageHeight Or pbs\y < 0
diry = -diry
EndIf
If pbs\x > ImageWidth Or pbs\x < 0
dirx = -dirx
EndIf
hits = hits - 1
wend
Next
End Function
I want it to be able to shoot many bullets, but I cant!! everything else in my code is right , this is inside the main loop.