I was talking about a collision detection problem, but after I fixed that I added more to the code and caused a much more complicated problem.
To create a large, scrolling tilemap I simply made the sprite's position remain constant, and instead of changing the sprite's coordinates I changed the x and y offset in the tilemap function.
For movement purposes, it works! However, something is just off. what is displayed is not aligned with what the processor reads, because I can walk through solid tiles, but not invisible tiles with an identical pattern to the real ones, but in a different place.
X and Y are the X offset and Y offset variables, the sprite's position on the screen is (40, 24), so how can I know what the starting values for X and Y should be to make sure it aligns and the right tiles are solid?