All Projects → xaguzman → pathfinding

xaguzman / pathfinding

Licence: Apache-2.0 license
Java pathfinding framework.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to pathfinding

Unciv
Open-source Android/Desktop remake of Civ V
Stars: ✭ 2,744 (+2819.15%)
Mutual labels:  libgdx
libgdx-transitions
libgdx screen transitions/fading
Stars: ✭ 43 (-54.26%)
Mutual labels:  libgdx
gdx-gameanalytics
Gameanalytics.com client implementation for libGDX
Stars: ✭ 28 (-70.21%)
Mutual labels:  libgdx
Destinationsol
Official continuation of Destination Sol, the great fun little arcade space shooter from http://sourceforge.net/projects/destinationsol/ Modules live at https://github.com/DestinationSol/
Stars: ✭ 214 (+127.66%)
Mutual labels:  libgdx
Yarn-Weaver
simple tool built in Unity C# to test Yarn files, good for game devs and narrative designers
Stars: ✭ 52 (-44.68%)
Mutual labels:  gamedev-tool
Koru
A 2D multiplayer sandbox game.
Stars: ✭ 78 (-17.02%)
Mutual labels:  libgdx
Klooni1010
libGDX game based on the original 1010!
Stars: ✭ 163 (+73.4%)
Mutual labels:  libgdx
gdx-sqlite
A cross-platform extension for database handling in Libgdx
Stars: ✭ 61 (-35.11%)
Mutual labels:  libgdx
DoubleHelix
A live wallpaper and daydream for Android featuring stylized glassy-looking DNA structures
Stars: ✭ 86 (-8.51%)
Mutual labels:  libgdx
pixelwheels
A top-down retro racing game for PC (Linux, macOS, Windows) and Android.
Stars: ✭ 315 (+235.11%)
Mutual labels:  libgdx
Gdx Rpg
java & libgdx制作的RPG游戏! an RPG by java and LibGDX
Stars: ✭ 239 (+154.26%)
Mutual labels:  libgdx
EasyStage
A stage profile tool for libgdx
Stars: ✭ 17 (-81.91%)
Mutual labels:  libgdx
tripeaks-gdx
A simple tri peaks solitaire game using libGDX.
Stars: ✭ 45 (-52.13%)
Mutual labels:  libgdx
Gdx Pay
A libGDX cross-platform API for InApp purchasing.
Stars: ✭ 195 (+107.45%)
Mutual labels:  libgdx
GDX-lazy-font
auto self-generate BitmapFont for libgdx 1.5.0 +
Stars: ✭ 26 (-72.34%)
Mutual labels:  libgdx
Mundus
A 3D world/level editor built with Java, Kotlin & libGDX.
Stars: ✭ 164 (+74.47%)
Mutual labels:  libgdx
ForgE
Simple clone of RPG maker using LibGdx
Stars: ✭ 17 (-81.91%)
Mutual labels:  libgdx
WurfelEngineSDK
Isometric game engine. Open world, block/voxel based and sprite rendering.
Stars: ✭ 96 (+2.13%)
Mutual labels:  libgdx
bialjam17
💫 The game that won the BialJam'17 event
Stars: ✭ 55 (-41.49%)
Mutual labels:  libgdx
kickoff
Open Kick-Off is a fun rewriting attempt of the cult football game Kick Off 2 designed by Dino Dini and released in 1990 by Anco for the Atari ST and the Commodore Amiga. It is written in Java with the help of libGDX.
Stars: ✭ 32 (-65.96%)
Mutual labels:  libgdx

Build Status

pathfinding - APACHE LICENSE 2.0

A java pathfinding library meant to be used for games. It is generic enough to be used in different kind of graphs (though, right now it only has implementation for grid graphs).

It was heavily inspired by this javascript library. Code initially was adapted, then some modifications were made.

This library works with Libgdx's html5 backend, it was even used in my #1GAM january entry.

Current versions:

  • 0.2.6

Installing

The library has been uploaded to sonatype oss repository. If you are using libgdx you can install it via graddle adding this dependency to your core project:

compile "com.github.xaguzman:pathfinding:0.2.6"

There's also the gdx-bridge extension to easily get pathfinding features in your game directly from your tmx maps.

Intro

The library works on a bunch of interfaces:

  • NavigationNode: this basically just represents a node of a graph. contains some getters and setters meant for navigation. Right now, only implementation is GridCell
  • NavigationGrap: a group of navigation nodes. Right now, only implementation is NavigationGrid
  • PathFinder: the implementation for the pathfinding algorithm, current options are:
    • AStarFinder
    • AStarGridFinder
    • JumpPointFinder
    • ThetaStarFinder
    • ThetaStarGridFinder

Finders are fed with so called PathFinderOptions, which determine how the pathfinding will work (allowing diagonal movement, for example).

How to use

You need to create a graph. Be aware the the NavigationGrid class, expects a bidimensional array of GridCell stored as [x][y]

//these should be stored as [x][y]
GridCell[][] cells = new GridCell[5][5];
	
//create your cells with whatever data you need
cells = createCells();
	
//create a navigation grid with the cells you just created
NavigationGrid<GridCell> navGrid = new NavigationGrid(cells);

Now, you need a finder which can work on your graph.

//create a finder either using the default options
AStarGridFinder<GridCell> finder = new AStarGridFinder(GridCell.class);
	
//or create your own pathfinder options:
GridFinderOptions opt = new GridFinderOptions();
opt.allowDiagonal = false;
	
AStarGridFinder<GridCell> finder = new AStarGridFinder(GridCell.class, opt);

Once you have both, a graph and a finder, you can find paths within your graph at any time.

List<GridCell> pathToEnd = finder.findPath(0, 0, 4, 3, navGrid);

That's pretty much all there is to using the library.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].