Quote: "and runs very slow"
It runs at a nice 60 fps here, but I will see what I can do to increase this.
For the loading... the main slowdown is probaly the maps, wich are verry large images.
To increase the loading time you can load only the images you need.
To increase the game speed.. Well you are looping through a lot of sprites in the array, when there aren't that many in the level.
Couldn't really see wich ones you loop and wich ones you don't in all the code, but I suggest you take a look on which items in the array you need to update.
You can also increase the loading time by converting your map images to memblocks and save them to a file.
You can use these functions for that:
Function convertImage(Image$, outputFile$)
Load Image Image$, 1
make memblock from image 1, 1
delete image 1
if file exist(outputFile$) then delete file outputFile$
open to write 1, outputFile$
make file from memblock 1, 1
close file 1
delete memblock 1
endFunction
Function LoadImage(file$, img)
open to read 1, file$
make memblock from file 1, 1
close file 1
make image from memblock img, 1
delete memblock 1
endFunction
btw, you menu isn't working here. It doesn't run when you press the start key.
It just clears the menu background (not the buttons) while you press the key.
When you release it, the menu looks just the same and the game isn't starting.
It also doesn't delete the buttons when the game starts, however that might be something I missed when making a fast workaround for the broken menu.
I can make a template for loading the needed images and looping though the needed sprites. However you will need to rewrite your whole code to fit the template.
So just say if you want the template or not