What should I use for large 2d games

Blitz3D Forums/Blitz3D Programming/What should I use for large 2d games

Before I read LineOf7s' post I created my own Map Editor. I made it so that I would use a type to get the images into my game, but when I use this code in the game it says "memory access violation"
If Z=1
For nground.ground=Each ground
If frame=0
If Not ImagesCollide(nground\image,nground\X,nground\Y,0,you,400,300,0)
nground\Y=nground\Y+6
Else
For nground.ground=Each ground
nground\Y=nground\Y-6
Next
EndIf
ElseIf frame=1
If Not ImagesCollide(nground\image,nground\X,nground\Y,0,you,400,300,0)
nground\Y=nground\Y+6
nground\X=nground\X-6
Else
For nground.ground=Each ground
nground\Y=nground\Y-6
nground\X=nground\X+6
Next
EndIf
ElseIf frame=2
If Not ImagesCollide(nground\image,nground\X,nground\Y,0,you,400,300,0)
nground\X=nground\X-6
Else
For nground.ground=Each ground
nground\X=nground\X+6
Next
EndIf
ElseIf frame=3
If Not ImagesCollide(nground\image,nground\X,nground\Y,0,you,400,300,0)
nground\Y=nground\Y-6
nground\X=nground\X-6
Else
For nground.ground=Each ground
nground\Y=nground\Y+6
nground\X=nground\X+6
Next
EndIf
ElseIf frame=4
If Not ImagesCollide(nground\image,nground\X,nground\Y,0,you,400,300,0)
nground\Y=nground\Y-6
Else
For nground.ground=Each ground
nground\Y=nground\Y+6
Next
EndIf
ElseIf frame=5
If Not ImagesCollide(nground\image,nground\X,nground\Y,0,you,400,300,0)
nground\Y=nground\Y-6
nground\X=nground\X+6
Else
For nground.ground=Each ground
nground\Y=nground\Y+6
nground\X=nground\X-6
Next
EndIf
ElseIf frame=6
If Not ImagesCollide(nground\image,nground\X,nground\Y,0,you,400,300,0)
nground\X=nground\X+6
Else
For nground.ground=Each ground
nground\X=nground\X-6
Next
EndIf
ElseIf frame=7
If Not ImagesCollide(nground\image,nground\X,nground\Y,0,you,400,300,0)
nground\X=nground\X+6
nground\Y=nground\Y+6
Else
For nground.ground=Each ground
nground\Y=nground\Y-6
nground\X=nground\X-6
Next
EndIf
EndIf
Next
EndIf

why?