Thread: Detecting Sound
View Single Post
  #6  
Old 03-10-2010, 09:00 PM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Couldn't something like this be a workaround? Maybe have distances for each baddy?
PHP Code:
//baddy.x+1.5 and baddy.y+2 for center if using regular character height/width
if (player.ani == "my_run") {
  if (
player.x in |baddy.x+1.5-15baddy.x+1.5+15| && player.y in |baddy.y+2-15baddy.y+2+15|) {
    
//stuffz
  
}
}
else if (
player.ani == "my_walk") {
  if (
player.x in |baddy.x+1.5-10baddy.x+1.5+10| && player.y in |baddy.y+2-10baddy.y+2+10|) {
    
//stuffz
  
}
}
else if (
player.ani == "my_creep") {
  if (
player.x in |baddy.x+1.5-5baddy.x+1.5+5| && player.y in |baddy.y+2-5baddy.y+2+5|) {
    
//stuffz
  
}

__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote