There is a lot of code to redo on your example, and without knowing what the purpose of everything is, and what the bug is I decided to piece together a quick skeleton app that I think does at least some of what you are trying to do.
The idea here is, if you want, look over the sample I have attached, and see if it makes sense to you. Then try and expand that code to get it to do what you want. It might be better then piece by piece trying to re-do/un-do/convert your existing code.
I tired to keep the code close to what you were doing and used just a few of your images, since I only did the background, grid, player, direction boxes and movement(I think that is the bulk of your code).
1. As there was little information to work with, it is not the best or only way to do it. If it was my project I would code it differently, but this example works and can be built on by you; if you choose to. I coded it this way, as it also leaves less for me to explain - in that I mean, I think for a beginner you will be able to grasp the example as it is better then say a more efficient-fancy way of coding it. If nothing else, it can give you an idea on how to re-do your code. I recommend redoing your code because of the lack of local variables, super-large functions, and way more lines of code then it seems needed.
2. The sample I have attached (although not doing exactly all of what your code was doing) is only 200 lines of code compared to nearly 2500 lines. So you can see where it will reduce your code alot and help in troubleshooting any bugs. The way you had your code( 2500 lines), makes debugging super hard.
3. I did nothing with the config file or anything else I normally would do, to try and keep to the code and keep things as simple as possible. I did notice a lot of 'scaling' in your code. I can guess why you are doing that, but I would try and avoid that; unless you really need to for some reason.
I hope this helps in some way.