I want an actor( the enemy) to follow the Main Actor. I tried to code a method to do this but when i put the method in act() it says:"cannot find symbol - variable player". Why does it searches for a variable?
Please Help.
1 2 3 4 5 6 7 8 9 10 | private void followPlayer(Actor player) { turnTowards(player.getX(), player.getY()); move( 1 ); setRotation( 0 ); } public void act() { followPlayer(player); } |