I have a knight subclass. It constantly finds the nearest enemy and orients to him, then moves accordingly. But when his orientation changes while moving, he continues moving in the direction he was originally, giving him the appearance of 'sliding' and not looking like he's moving naturally.
A diagram of what happens (if that helps)
this is my current code:
Any help would be greatly appreciated!
if(FindClosest()!= null) { //keep moving towards nearest enemy this.turnTowards(FindClosest().getX(),FindClosest().getY()); //turn towards nearest enemy this.move(speed); //move }