The problem in your code is that the argument of BGOFS are on line 20. Put BGOFS cameraBG[I],cameraX%,cameraY% in the same line.
I use this code on a map editor for my tactic rpg game. It's still a work in progress but it is too complex to use it as an example.
If you have a code where you want to add the camera, then I can try to add it for you. If not, then I could share my project.
1そうだね プレイ済み