I'm starting to program now, and I have the task of making a simple control with the keyboards in a "map" that is an image, and the cart can not cross the streets, the map is the attached image but I'm not being able to think of a logic to make the collisions using the x / y coordinates the areas in green, that is, everything that is not the street the cart can not walk my cart has size 40x20 pixels.
PS: I do not want the code ready, I want an aid to think of logic or some easier way of doing it, using x / y