View Single Post
  #6  
Old 11-13-2006, 10:59 PM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
If you don't mind using a circle for area detection use
PHP Code:
temp.distance = ((player.x - this.x)^2 + (player.y - this.y)^2)^0.5; 
Use a timeout to check when the var gets to a certain number.

Could/should also be able to do
PHP Code:
if (player.x in |this.x, this.x + this.width|)
{
  if (
player.y in |this.y, this.y + this.height|)
  {
  
//Hit detection =o
  
}
} 
Reply With Quote