Thread: screwy stake
View Single Post
  #15  
Old 08-18-2007, 10:08 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
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);
Reply With Quote