Simple Map Collision Detection (Array Based)

This is an example program which shows one way to do collision detection between a player and the map when the map data is stored in an array. In order to keep it simple, the map does not scroll, and the player is strictly smaller than the obstacles. Extra code would need to be added if the player was larger than the walls, but it was not included to keep the example as simple as possible.

The program is heavily commented, so look inside the code to see how it works. If you have any questions, please post them in the comments section! If they're not too broad (like how do I make a game out of this), I'll try to answer them!