Skip to content

Commit

Permalink
Ensure player doesn't spawn inside ground
Browse files Browse the repository at this point in the history
  • Loading branch information
Nixinova committed Aug 15, 2024
1 parent 77f25ff commit e86921a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/com/nixinova/main/Game.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,16 @@ public class Game {

public Game(InputHandler input) {
this.world = new World();
Coord3 startPosition = Coord3.fromSubBlock(world.minCorner.x + 0.5, Options.groundLevel, world.minCorner.z + 0.5);

double startX = world.minCorner.x + 0.5; // centre of block
double startY = Options.groundLevel + 1; // one block above the ground
double startZ = world.minCorner.z + 0.5; // centre of block
Coord3 startPosition = Coord3.fromSubBlock(startX, startY, startZ);
this.player = new Player(startPosition);

this.controls = new Controller(this, this.player);
this.input = input;

Options.createOptions();
}

Expand Down

0 comments on commit e86921a

Please sign in to comment.