View Single Post
  #1  
Old 06-12-2011, 10:56 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
vecx / vecy trouble

Hiya

I'm seeking advise-

I'm making an NPC which will kill the player in front of it within a certain distance

However, when I use something like this

HTML Code:
for (temp.pl: players) {
  if (temp.pl.x in |this.x + 1.5, this.x + 1.5 + (vecx(this.dir) * temp.view)| &&
      temp.pl.y in |this.y + 1.5, this.y + 1.5, (vecy(this.dir) * temp.view)|) {
    temp.pl.ani = "dead";
  }
}
This works if the NPC is facing down and right, but facing up or left it won't work. Any ideas?
__________________
Reply With Quote