|
@@ -4,6 +4,7 @@ import java.util.Iterator;
|
|
|
import java.util.LinkedList;
|
|
|
import pathgame.tilemap.Tile;
|
|
|
import pathgame.tilemap.TileMap;
|
|
|
+import pathgame.tilemap.Tiles;
|
|
|
|
|
|
public class Player
|
|
|
{
|
|
@@ -26,6 +27,7 @@ public class Player
|
|
|
private int objectivesAmount;
|
|
|
private int objectivesVisited = 0;
|
|
|
private final LinkedList<MinusStepsValues> steps = new LinkedList<>();
|
|
|
+ private Tile currentTile;// = Tiles.GRASS;
|
|
|
|
|
|
public Player()
|
|
|
{
|
|
@@ -70,12 +72,17 @@ public class Player
|
|
|
|
|
|
int currentTileX = Math.round(x);
|
|
|
int currentTileY = Math.round(y);
|
|
|
- Tile currentTile = map.getTile(currentTileX, currentTileY);
|
|
|
-
|
|
|
+
|
|
|
+ //TODO: Bug beheben: Exception, wenn Spieler sofort an den unteren Levelrand geht (auch am rechten Levelrand)
|
|
|
+ //ArrayIndexOutOfBoundsException: Index 10 out of bounds for length 10
|
|
|
+ //System.out.println(currentTileY);
|
|
|
+ //currentTile = Tiles.GRASS;
|
|
|
+ currentTile = map.getTile(currentTileX, currentTileY);
|
|
|
+ //System.out.println(currentTile);
|
|
|
currSpeedSlowdown = currentTile.getEnergyCost(abilities);
|
|
|
lastX = x;
|
|
|
lastY = y;
|
|
|
-
|
|
|
+
|
|
|
if(isOnTile())
|
|
|
{
|
|
|
velX = 0.0f;
|
|
@@ -266,4 +273,9 @@ public class Player
|
|
|
{
|
|
|
return isMoving;
|
|
|
}
|
|
|
+
|
|
|
+ public Tile getCurrTile()
|
|
|
+ {
|
|
|
+ return currentTile;
|
|
|
+ }
|
|
|
}
|