View Single Post
  #21  
Old 08-31-2007, 11:41 PM
Polo Polo is offline
Classic Systems Admin
Join Date: Sep 2002
Location: Vancouver, Canada
Posts: 735
Polo is on a distinguished road
Send a message via AIM to Polo
You should not be subtracting 1/32 (half a pixel), as doing so will give you an innacurate result.

If you're wondering why, it's because a pixel has shape to it: it has both a left and right edge. The easiest way to demonstrate this is to draw 2 adjoining squares on a piece of paper with 0 and 2 written on the outside bottom corners, and 1 written on the touching corner. I'm fairly sure that you'll agree the centre is at 1 and not 0.5.

PHP Code:
  ___ ___
 
|   |   |
 |
___|___|
 
0   1   2 
In light of that, the usual coordinates to use for movement are a 2 by 2 square centred exactly on 1.5, 2 (just as Stefan said).
__________________
Be good little players, or Master Storm will ban you!



Proof that the staff are crazy..
*Ghost Pirate: I'm a little teacup short and stubbe here is my raygun here is my butt
DragonX: Jumping jack rabbits Batman! Our eggo waffles have been stolen! To the batmobile Robin!
X-Mann (RC): I have a head ache
Reply With Quote