Hi! I’m using adv3lite. I have Actors who can be commanded to move in a specific direction.
modify Actor
handleCommand(action) {
if (action == Travel) {
if (direction == north) {
self.moveInto(self.location.north);
} else if (direction == south) {
self.moveInto(self.location.south);
} else if (direction == east) {
self.moveInto(self.location.east);
} else if (direction == west) {
self.moveInto(self.location.west);
} else if (direction == up) {
self.moveInto(self.location.up);
} else if (direction == down) {
self.moveInto(self.location.down);
} else {
inherited(action);
}
} else {
inherited(action);
}
}
;
How exactly do I find the direction of the Travel
command when it’s being used to command an Actor? direction
doesn’t work, and dirMatch.dir
throws a null reference error. Any help would be appreciated. Thanks!