From e86921ae18ec75d162bb678dce7057c7d9585fc7 Mon Sep 17 00:00:00 2001 From: Nixinova Date: Thu, 15 Aug 2024 16:24:02 +1200 Subject: [PATCH] Ensure player doesn't spawn inside ground --- src/com/nixinova/main/Game.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/com/nixinova/main/Game.java b/src/com/nixinova/main/Game.java index e8de546..94e034e 100644 --- a/src/com/nixinova/main/Game.java +++ b/src/com/nixinova/main/Game.java @@ -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(); }