Click()
if(src in obounds(usr,4))
usr.contents+=src
Problem description:
Now, this works and all, but a slight problem arises. For some reason, if the player is 32 pixels or so to the right of the object, (s)he can pick it up. If they're the same distance to the left, however, they cannot. I can only wonder why. I've tried everything, from adjusting the bounding boxes, etc, but in truth, I'm not quite sure how they should work.
This will check for any bounding boxes within range of:
px+usr.bound_x-4
py+usr.bound_y-4
px+usr.bound_x+usr.bound_width+4
py+usr.bound_y+usr.bound_height+4
Where px = (usr.x-1) * TILE_WIDTH + usr.step_x
Where py = (usr.y-1) * TILE_HEIGHT + usr.step_y
If even a single pixel of the bounding box of an item is in that distance, it will return the object.