Hello,
I tried adding the code you gave me and it goes like this:
if GameMode = 2
//Spawn Boxes
if timer() - Time# > SpawnRate
inc ThisBox, 1
Boxes.length = ThisBox
Boxes[ThisBox] = CloneSprite (Boxes[0])
SetSpritePosition(Boxes[ThisBox], random(90,210), 40)
SetSpriteFrame(Boxes[ThisBox], Random(1,19))
SetSpriteScale(Boxes[ThisBox], 0.25, 0.25)
SetSpritePhysicsOn(Boxes[ThisBox],2)
SetSpriteShape(Boxes[ThisBox],3)
Time# = timer()
EndIf
For n = Boxes.length to 0 step -1
//Delete Boxes
If GetSpriteY(Boxes[n]) >= 400 then DeleteSprite(Boxes[n])
Boxes[n].remove()
next n
EndIf
//Game Over Screen
If GameMode = 3
for n = 0 to Boxes.length
DeleteSprite(Boxes[n])
Boxes[n] = 0
next n
EndIf
The problems are two.
1. In Boxes[n].remove(), it says unexpected token "." Array must be followed by an equals and an expression here. Its the same error I got when I tried the same command before.
2. The code to delete the boxes once the game is over deletes also the initial box that is created and when you press replay it doesn't spawn any boxes at all.
So I put on Start pressed(the button you press to start the game) to create the array again but it doesn't seem to work.
Dim Boxes[0] as integer
ThisBox = 0
Boxes[ThisBox] = CreateSprite(0)
SetSpritePosition(Boxes[ThisBox],50,-200)
AddSpriteAnimationFrame(Boxes[ThisBox], LoadImage("Box1.png"))
AddSpriteAnimationFrame(Boxes[ThisBox], LoadImage("Box2.png"))
AddSpriteAnimationFrame(Boxes[ThisBox], LoadImage("Box3.png"))
Thanks!