diff --git a/GameClient/src/main/java/me/thatshawt/gameClient/GameClient.java b/GameClient/src/main/java/me/thatshawt/gameClient/GameClient.java index 2dbb42a..66753f5 100644 --- a/GameClient/src/main/java/me/thatshawt/gameClient/GameClient.java +++ b/GameClient/src/main/java/me/thatshawt/gameClient/GameClient.java @@ -405,7 +405,8 @@ private void drawUILayer(Graphics g){ g.setFont(UI_FONT); for(TileChunk chunk : - chunks.chunksWithinRenderDistance(getX(),getY(), player.getCamera().getRenderDistance())){ + chunks.chunksWithinRenderDistance( + player.getX(), player.getY(), player.getCamera().getRenderDistance())){ for(Entity entity : chunk.entityList){ if(entity instanceof Player) { Player playerEntity = (Player)entity; diff --git a/GameCore/src/main/java/me/thatshawt/gameCore/game/Entity.java b/GameCore/src/main/java/me/thatshawt/gameCore/game/Entity.java index c423123..8adcac7 100644 --- a/GameCore/src/main/java/me/thatshawt/gameCore/game/Entity.java +++ b/GameCore/src/main/java/me/thatshawt/gameCore/game/Entity.java @@ -1,9 +1,6 @@ package me.thatshawt.gameCore.game; -import me.thatshawt.gameCore.tile.ChunkCoord; -import me.thatshawt.gameCore.tile.ChunkMap; -import me.thatshawt.gameCore.tile.Tile; -import me.thatshawt.gameCore.tile.TileChunk; +import me.thatshawt.gameCore.tile.*; import java.io.Serializable; import java.util.UUID; @@ -65,9 +62,9 @@ protected void updateChunkLocation(int oldX, int oldY, int newX, int newY){ TileChunk previousChunk = chunks.get(ChunkCoord.fromTileXY(oldX, oldY)); TileChunk newChunk = chunks.get(ChunkCoord.fromTileXY(newX, newY)); if(newChunk != previousChunk){ - System.out.println("moved entity " + this + " from " + previousChunk + " to " + newChunk); - previousChunk.removeEntity(this); +// System.out.println("moved entity " + this + " from " + previousChunk + " to " + newChunk); newChunk.addEntity(this); + previousChunk.removeEntity(this); } } @@ -85,7 +82,7 @@ protected void updateChunkLocation(int oldX, int oldY, int newX, int newY){ */ public boolean checkCollision(Direction direction){ Tile target = chunks.tileAt(getX() + direction.xOffset, getY() + direction.yOffset); - return target != null; + return target instanceof AirTile; } @Override diff --git a/GameCore/src/main/java/me/thatshawt/gameCore/tile/ChunkGenerator.java b/GameCore/src/main/java/me/thatshawt/gameCore/tile/ChunkGenerator.java new file mode 100644 index 0000000..3f59784 --- /dev/null +++ b/GameCore/src/main/java/me/thatshawt/gameCore/tile/ChunkGenerator.java @@ -0,0 +1,7 @@ +package me.thatshawt.gameCore.tile; + +public class ChunkGenerator { + + + +} diff --git a/GameCore/src/main/java/me/thatshawt/gameCore/tile/TileChunk.java b/GameCore/src/main/java/me/thatshawt/gameCore/tile/TileChunk.java index 88488f0..356d9f7 100644 --- a/GameCore/src/main/java/me/thatshawt/gameCore/tile/TileChunk.java +++ b/GameCore/src/main/java/me/thatshawt/gameCore/tile/TileChunk.java @@ -25,10 +25,10 @@ private TileChunk(int size){ } } - public static final int CHUNK_SIZE = 4; + public static final int CHUNK_SIZE = 8; public TileChunk(){ - this(CHUNK_SIZE);//idk cool size i guess + this(CHUNK_SIZE); } public void addEntity(Entity entity){