Added Astar algo
This commit is contained in:
parent
79ae1d0dcc
commit
148c0c739f
4 changed files with 258 additions and 2 deletions
|
|
@ -34,6 +34,15 @@ public class Map {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the size of the map
|
||||
*
|
||||
* @return The size of the map
|
||||
*/
|
||||
public Vector2i getSize(){
|
||||
return new Vector2i(width,hight);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the pos of the map by the pixel
|
||||
* @param x x pixels
|
||||
|
|
@ -66,6 +75,8 @@ public class Map {
|
|||
* @return True if empty else false
|
||||
*/
|
||||
public boolean isPosEmpty(int x, int y){
|
||||
if(x < 0 || y < 0 || x >= width || y >= hight)
|
||||
return false;
|
||||
if(map[x][y] == null){
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue