Thread: Damn move()
View Single Post
  #1  
Old 01-21-2007, 12:12 PM
Raeiphon Raeiphon is offline
I never asked for this.
Join Date: Jun 2005
Posts: 855
Raeiphon is on a distinguished road
Damn move()

NPC Code:

this.movex = playerx - x; // x needed to travel to player
this.movey = playery - y; // y needed to travel to player
if (player.dir=1){ this.desx = 1.7; this.desy = 1; }
if (player.dir=0) { this.desx = -1.7; this.desy = 1; }
if (player.dir=2) { this.desx = 1.7; this.desy = -1.7; }
if (player.dir=3) { this.desx = -1.7; this.desy = -1.7; }
setCharAni("walk","");
move(this.movex+this.desx,this.movey+this.desy,1,1 );
setCharAni("idle","");



Inefficient, I know, but it gets the job done.

Basically, it's supposed to move the npc so it looks like it's standing next to me. Problem is, i'm an aesthetics freak, and the fact that it just glides along concerns me. How would I go about making the npc use the walk gani through the move sequence?
__________________

I hope for nothing. I fear nothing. I am free.
Reply With Quote