04-11-2006, 06:34 AM
Ok well I have my NPC scripts completed and they work fine up to the point of moving each NPC. The way I have it set up is I have tile coodinate positions (starting and an additional coodinate set for each tile movement). So lets say I have the following in a data file
With my setup this should move the NPC to thr right 3 tiles then down 2 tiles in that order. The plan is to have the NPCs follow a set path and when they reach the end they either turn around and go back or start over at the beggining again. In any case I am not looking for help with my code, but I would like to know if anyone has a better way to move NPCs than this, or a simple way to code what I am trying to do, because my current code isn't working =/
The way I am doing it now I compare each x and y coodinate to the current NPC coodinate if the value is larger or smaller it moves in that direction, after it moves to meet that coodinate the next value of data is read into the NPC object.
Code:
8,0
9,0
10,0
10,1
10,2
The way I am doing it now I compare each x and y coodinate to the current NPC coodinate if the value is larger or smaller it moves in that direction, after it moves to meet that coodinate the next value of data is read into the NPC object.