The actor the user is in control of is called "PlatformJumper" and i want the "enemy" actor to follow the PlatformJumper if its in range. Turning would be helpful.


1 2 3 4 5 6 | int range = 200 ; // this line added for set-up if ( ! getObjectsInRange( range, Enemy. class ).isEmpty() ) { Actor pj = getObjectsInRange( range, Enemy. class ).get( 0 ); turnTowards( pj.getX(), pj.getY() ); } |
1 | Actor pj = (Actor) getObjectsInRange( range, Enemy. class ).get( 0 ); |
1 2 3 4 | public void act() { followHuman(); } |
1 2 3 4 5 6 | int range = 200 ; // this line added for set-up if ( ! getObjectsInRange( range, Enemy. class ).isEmpty() ) { Actor pj = getObjectsInRange( range, Enemy. class ).get( 0 ); turnTowards( pj.getX(), pj.getY() ); } |
1 | listName.size() > 0 |
1 | listName.isEmpty() |