
08-18-2007, 10:08 PM
|
|
Will work for food. Maybe
|
 |
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
|
|
|
Well, % is modulus, which is the remainder of division.
So on a gmap, the gmap acts as one giant level, so instead of your coordinates being from 0-64, it's 64*amount of gmap levels+player's actual coordinates in the level.
So... if you want the coordinates of the player in the actual level, not gmap, you'd do player.x%64 which translates to divide the player's x by 64, and return the remainder, which in this case would be the player's coordinates in relation to the level, not the gmap.
Also, you might want to try this, along with the player.x/y%64:
level.tiles[blah,blah]
level.updateboard(x,y,2,2); |
|
|
|