Quote: "but for create bullet there is another way that we don't use insert or remove elemnts in array?"
Yes, you could create an array upfront with enough slots to hold the max amount of bullets you require. And then just cycle through them all...
Like so (this is psuedo code, untested, and unlikely to work out the box... But should give you the idea...);
global MaxBullets = 50
global Bullets[MaxBullets]
global BulletNumber
do
if GetRawKeyPressed(32)
CreateBullet()
endif
for i=1 TO MaxBullets
if GetSpriteExists(Bullet[i]) = 1
SetSpritePosition(Bullet[i],GetSpriteX(Bullet[i]),GetSpriteY(Bullet[i])-4)
if GetSpriteY(Bullet[i]) < -5
DeleteSprite(Bullet[i])
endif
endif
next i
Sync()
loop
function CreateBullet()
BulletNumber = BulletNumber + 1
if BulletNumber = MaxBullets + 1 Then BulletNumber = 1
Bullet[BulletNumber] = CreateSprite(0)
SetSpriteSize(Bullet[BulletNumber], 1, 4)
SetSpritePosition(Bullet[BulletNumber],GetSpriteXByOffset(Player)-0.5,GetSpriteYByOffset(Player)-5)
endfunction
EDIT
Quote: "UPDATE: I think for do it should create User Data Type."
Yes, Data Types would be a better solution, but in my opinion, more complex... I've only just started using Data Types myself, took me a while to work em out
EDIT2
In my example above, it is possible that the user could button bash fire more than 50 times before the first bullet gets a chance to be deleted... Easily resolved, but will let you work that out
Using AppGameKit V2 Tier 1