diff --git a/src/main/java/com/github/hydos/ginger/Litecraft.java b/src/main/java/com/github/hydos/ginger/Litecraft.java index 4c561b8..c19a61f 100644 --- a/src/main/java/com/github/hydos/ginger/Litecraft.java +++ b/src/main/java/com/github/hydos/ginger/Litecraft.java @@ -29,13 +29,13 @@ public class Litecraft extends Game public Litecraft() { Constants.movementSpeed = 0.00005f; - Constants.turnSpeed = 0.00002f; + Constants.turnSpeed = 0.00006f; Constants.gravity = -0.0000000005f; Constants.jumpPower = 0.00005f; Window.create(1200, 800, "LiteCraft", 60); GingerUtils.init(); - Window.setBackgroundColour(0.2f, 0.2f, 0.8f); - TexturedModel dirtModel = ModelLoader.loadGenericCube("block/cubes/soil/dirt.png"); + Window.setBackgroundColour(0.2f, 0.2f, 0.6f); + TexturedModel dirtModel = ModelLoader.loadGenericCube("block/cubes/soil/gravel.png"); StaticCube.scaleCube(1); Player player = new Player(dirtModel, new Vector3f(0, 0, -3), 0, 180f, 0, new Vector3f(0.2f, 0.2f, 0.2f)); Camera camera = new Camera(new Vector3f(0, 0.1f, 0), player); diff --git a/src/main/java/com/github/hydos/ginger/engine/elements/objects/Player.java b/src/main/java/com/github/hydos/ginger/engine/elements/objects/Player.java index d0f183b..78098c2 100644 --- a/src/main/java/com/github/hydos/ginger/engine/elements/objects/Player.java +++ b/src/main/java/com/github/hydos/ginger/engine/elements/objects/Player.java @@ -25,7 +25,7 @@ public class Player extends RenderObject { this.currentSpeed = Constants.movementSpeed; } - else if (Window.isKeyPressed(GLFW.GLFW_KEY_S)) + else if (Window.isKeyDown(GLFW.GLFW_KEY_S)) { this.currentSpeed = -Constants.movementSpeed; } @@ -39,8 +39,6 @@ public class Player extends RenderObject } else if (Window.isKeyDown(GLFW.GLFW_KEY_D)) { this.currentTurn = -Constants.turnSpeed; } - if (!Window.isKeyDown(68) || !Window.isKeyDown(65)) - { this.currentTurn = 0; } if (Window.isKeyDown(GLFW.GLFW_KEY_SPACE)) { jump(); diff --git a/src/main/java/com/github/hydos/ginger/engine/io/Window.java b/src/main/java/com/github/hydos/ginger/engine/io/Window.java index ad2cc77..ac2bf56 100644 --- a/src/main/java/com/github/hydos/ginger/engine/io/Window.java +++ b/src/main/java/com/github/hydos/ginger/engine/io/Window.java @@ -116,12 +116,6 @@ public class Window public static boolean isKeyDown(int keycode) { return GLFW.glfwGetKey(window, keycode) == 1; } - public static boolean isKeyPressed(int keyCode) - { return isKeyDown(keyCode) && !keys[keyCode]; } - - public static boolean isKeyReleased(int keyCode) - { return !isKeyDown(keyCode) && keys[keyCode]; } - public static boolean isMouseDown(int mouseButton) { return GLFW.glfwGetMouseButton(window, mouseButton) == 1; } diff --git a/src/main/resources/shaders/entityVertexShader.glsl b/src/main/resources/shaders/entityVertexShader.glsl index e5ed0a2..cd78413 100644 --- a/src/main/resources/shaders/entityVertexShader.glsl +++ b/src/main/resources/shaders/entityVertexShader.glsl @@ -20,8 +20,8 @@ const vec4 plane = vec4(0, -1, 0, 15); uniform float useFakeLighting; -const float density = 0.01; -const float gradient = 5.0; +const float density = 0.025; +const float gradient = 3.0; void main(void){ @@ -35,9 +35,7 @@ void main(void){ pass_textureCoords = textureCoords; vec3 actualNormal = normal; - if(useFakeLighting > 0.5){ - actualNormal = vec3(0.0, 1.0, 0.0); - } + actualNormal = vec3(0.0, 1.0, 0.0); surfaceNormal = (transformationMatrix * vec4(actualNormal, 0.0)).xyz; for(int i=0;i<5;i++){