Thread: actionmouseover
View Single Post
  #8  
Old 08-30-2002, 06:28 PM
Com013 Com013 is offline
Registered User
Join Date: Aug 2002
Location: GMT+1
Posts: 381
Com013 is on a distinguished road
Quote:
Originally posted by emortylone
NPC Code:

if (created)
{ timeout=0.25;}
if (timeout)
{ if (abs(mousex-x)=<1 && abs(mousey-y)=<1)
{ actions;}
timeout=0.25;
}


It would just check that the mouse is within a distance of one tile from the top left corner.

This might be a bit better:
NPC Code:

if (playerenters || timeout) {
if (mousex >= x && mousex < x+npcs[0].width &&
mousey >= y && mousey < y+npcs[0].height) {
// do stuff
}
timereverywhere;
timeout = 0.05;
}

__________________
Com013
Former Admin of the LAT on Graal The Adventure

e-mail: [email protected]
Reply With Quote