Ver Fonte

Usage of WaterMaster::isPointUnderWater

Tankernn há 8 anos atrás
pai
commit
829a8c15df
1 ficheiros alterados com 2 adições e 3 exclusões
  1. 2 3
      src/main/java/eu/tankernn/game/Game.java

+ 2 - 3
src/main/java/eu/tankernn/game/Game.java

@@ -86,10 +86,9 @@ public class Game extends TankernnGame3D {
 	
 	public void update() {
 		super.update();
-		//TODO Check if there is a water tile above
-		if (camera.getPosition().y < 0 && postProcessor.blurFactor < 2)
+		if (waterMaster.isPointUnderWater(camera.getPosition()) && postProcessor.blurFactor < 2)
 			postProcessor = new PostProcessor(loader, true);
-		else if (camera.getPosition().y > 0 && postProcessor.blurFactor > 0)
+		else if (!waterMaster.isPointUnderWater(camera.getPosition()) && postProcessor.blurFactor > 0)
 			postProcessor = new PostProcessor(loader, false);
 		if (picker.getCurrentTerrainPoint() != null) {
 			entities.get(1).setPosition(picker.getCurrentTerrainPoint());