attacksetup:
bltimg = LoadImage("bullet.png")
type typebullet
direction as integer[40]
speed as integer
endtype
bullet as typebullet
for i = 10 to 40
CreateSprite(i,bltimg)
SetSpritePosition(i,512,384)
bullet.direction[i] = random(1,359)
next i
return
attacktest:
speed = 4
for i = 10 to 40
newxpos = GetSpriteX(i) + cos(bullet.direction[i])*speed
newypos = GetSpriteY(i) + sin(bullet.direction[i])*speed
SetSpritePosition(i,newxpos,newypos)
next i
return
The bullet's direction is random but each time they shoot into the same direction, they also shoot in grid like directions, can anyone help me with this?