View Single Post
  #2  
Old 05-15-2012, 10:47 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Just on a readability note, you should make constants like this.mapimage and this.scale actually constants:

PHP Code:
//#CLIENTSIDE
const MAP_IMAGE "delt_deltlite-mapimg.png";
const 
SCALE 8;
const 
MAP_DIM = {117};
const 
MARKER "plisticononline.png";

function 
onCreated() {
  
SetPref();
  
DrawMap();
  
onTimeout();
}

// ... 
It makes it easier for whoever is reading your script to understand that you're just working with magic numbers that never change throughout the script.

You should probably also set profile.modal = false; on the mini map control (MapContainer) so it can't accidentally steal focus from the client.

And a 0.05 second timeout is almost certainly not necessary. Ideally you'd only calculate the position a couple times per second or less, and only when the player has moved.
__________________
Reply With Quote