ID:153974
 
Pixel movement is, as if it wasn't obvious enough, non-tiled movement that uses pixel_x and pixel_y to make things appear like they're not moving within the tiles. I could make this work all and well enough, but there is a problem, shown here:
 ____
| |
|tile|
| 2 |
|____| two labelled tiles
| |
|tile|
| 1 |
|____|

____
| |
| | X is a mob
| |
|____|
|XXXX|
|XXXX| mob is in tile 1
|XXXX|
|XXXX|

____
| |
| |
| |
|XXXX| still in tile 1
|XXXX|
|XXXX|
|XXXX|
|____|

____
| |
| |
|XXXX|
|XXXX| mob is halfway between tiles 1 and 2
|XXXX| but which one is he in?
|XXXX|
| |
|____|

So the problem is the halfway space between tiles. Which loc should the mob be in? Is there a quick and easy way to handle this problem, or do I have to write out lines upon lines of gritty code?

(This isn't for the 4K challenge, so I don't need evil, brace-using code.)
Obviously you need to create a temporary object which occupies the other space, sicne it is halfway in between, it occupies half of each, and thus, you need to know where it is.

Actually, that paragraph meant absolutely nothing.

Really, it doesn't matter. Just move the mob into the next tile when it reaches half-way.
In response to Garthor
Well, I'm using a projectile system in my game, so I need to know exactly where the player is, otherwise the projectile might just fly through. I never thought of using a temporary object though....
I really just depends on what you want and if you have any special circumstances to account for. Assuming you're using pixels from +16 to -16, just changing the loc if the new pixel value is greater than abs(16) would work simply enough.
In response to WizDragon
Actually, that first paragraph was random garbage. Glad it helped, kinda like finding a new DVD player in the local dump.

Oh yeah, I'm making a pong game (for the 4k challenge) and it had pixel offsets too. To check for collisions...
if((P.y*32 + P.pixel_y) - (y*32 + pixel_y) <= 16 && (P.y*32 + P.pixel_y) - (y*32 + pixel_y) >= -16)

Where P would be a player in oview(1). Also, notice that it's just taking the y value into account, you need to make a check for the x value too.