libgdx waypoints??? anyone

Hi does anyone know how to implement waypoints for enemy to follow be it random or fixed.

thank you.

johnny

Have each entity contain a [icode]List waypoints;[/icode], when monster is ready to move, it sets [icode]waypoints.remove(0)[/icode] as it’s current location to walk to.
When it reaches that point (or close enough), set seek location to next point: [icode]waypoints.remove(0)[/icode].

Add waypoints on top of the list like so: [icode]someEntity.waypoints.add(new Point(…));[/icode]

You could also use an ArrayDeque (might be more “proper”), but an ArrayList will work fine.

If your game has walls or other obstacles then you also may need to research pathfinding for advanced movements using way points…

thank you for the reply i’ll try to do it if i can

thanks