|
@@ -4,6 +4,7 @@ import me.hammerle.snuviengine.api.Renderer;
|
|
|
import me.hammerle.snuviengine.api.Texture;
|
|
|
import pathgame.gameplay.Player;
|
|
|
import pathgame.tilemap.TileMap;
|
|
|
+import pathgame.tilemap.Tiles;
|
|
|
|
|
|
public class PlayerRenderer
|
|
|
{
|
|
@@ -31,6 +32,8 @@ public class PlayerRenderer
|
|
|
baseY = baseY - (int) baseY;
|
|
|
|
|
|
int tIndex = 0;
|
|
|
+ float xTexOff = 0;
|
|
|
+ float yTexOff = 0;
|
|
|
|
|
|
CHARACTER.bind();
|
|
|
if(p.getVelX() > 0)
|
|
@@ -62,8 +65,21 @@ public class PlayerRenderer
|
|
|
|
|
|
yIndex = 0;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ if(p.getCurrTile()== Tiles.DEEP_WATER)
|
|
|
+ {
|
|
|
+ yTexOff = 0.5f;
|
|
|
+ }
|
|
|
+ else if(p.getCurrTile()== Tiles.SHALLOW_WATER)
|
|
|
+ {
|
|
|
+ xTexOff = 0.5f;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
r.getTextureRenderer().drawRectangle(ix, iy, ix + playerSize, iy + playerSize,
|
|
|
- tIndex * 0.25f, yIndex * 0.25f, (tIndex + 1) * 0.25f, yIndex * 0.25f + 0.25f);
|
|
|
+ tIndex * 0.125f + xTexOff, yIndex * 0.125f + yTexOff,
|
|
|
+ (tIndex + 1) * 0.125f + xTexOff, yIndex * 0.125f + 0.125f + yTexOff);
|
|
|
}
|
|
|
|
|
|
private int checkForAnimationIndex(float base)
|