Skip to content

Commit

Permalink
ADDED mathematical and logical expression to nicely format blocks
Browse files Browse the repository at this point in the history
Realised that it is impossible to use one image if the square is only one pixel wide. You could scale it up but I decided not to go that route.
  • Loading branch information
SonicGDX committed Dec 20, 2022
1 parent 7ffa100 commit f12016d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/src/com/sonicgdx/sonicswirl/SonicGDX.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ public void render(float delta) {





//TODO Add collision logic

dr.setProjectionMatrix(camera.combined);
dr.begin(ShapeRenderer.ShapeType.Line);
for (int i=0;i<8;i++)
Expand All @@ -137,9 +141,7 @@ public void render(float delta) {
drawChunkDR(i,j);
}
}
dr.rect(100,100,10,10);
dr.end();
//TODO Add collision logic

// tells the SpriteBatch to render in the coordinate system specified by the camera
Init.batch.setProjectionMatrix(camera.combined);
Expand Down Expand Up @@ -200,6 +202,8 @@ public void drawChunkDR(int chunkX, int chunkY) {
if (tm.map[chunkX][chunkY][blockX][blockY].empty){
break;
}
if (grid == 0) dr.setColor(new Color(0));
else dr.setColor(new Color(0.125F * blockY,0,grid,0));

dr.rect(blockX*16+grid+(128*chunkX),blockY*16+(128*chunkY),1,tm.map[chunkX][chunkY][blockX][blockY].height[grid]);
if ((int) x == (chunkX*128 + blockX*16+grid))
Expand Down

0 comments on commit f12016d

Please sign in to comment.