What line have an out of range error occured? I point out a couple of suspicious points in your program as follows. 1) The array name applied in line 5 (LOAD) and line 7 (BGLOAD) are unmatch. 2) You have not defined BG layer #3 as 64*64 map yet.