Skip to content
This repository has been archived by the owner on Oct 9, 2019. It is now read-only.

Commit

Permalink
Build-142: Fixes and some changes.
Browse files Browse the repository at this point in the history
# Changes
Reduced effect of parallax mapping.
Testing wet surface in blocks.
Add JavaDoc task to build.gradle.
Player velocity now are clamped to 2.
Ice now has lower velocity reduction.
Entities now slide on ice.

# BugFixes
Fixed JUnit Tests.
Fixed game settings not saving the correct version of the file.
Fixed player unable to jump inside water or swim.
  • Loading branch information
Guerra24 committed Jan 18, 2016
1 parent 547a68a commit 9bd9a2b
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 23 deletions.
14 changes: 7 additions & 7 deletions assets/game/settings.conf
@@ -1,15 +1,15 @@
#Voxel Settings
#Sat Jan 16 17:52:02 CST 2016
#Sun Jan 17 18:01:47 CST 2016
UPS=30
VSYNC=false
useMotionBlur=false
useFXAA=true
useFXAA=false
DrawDistance=2
SettingsVersion=3
useParallax=false
useVolumetricLight=true
SettingsVersion=4
useParallax=true
useVolumetricLight=false
TESTXMOD=Hello Voxel
FPS=30
useDOF=false
useReflections=true
FPS=30
useShadows=true
useReflections=true
4 changes: 4 additions & 0 deletions build.gradle
Expand Up @@ -56,6 +56,10 @@ dependencies {
testCompile group: 'junit', name: 'junit', version: '4.+'
}

task generateJavaDoc(type: Javadoc) {
failOnError = false
}

sourceSets {
main {
java.srcDir("${projectDir}/src/main/java/")
Expand Down
Expand Up @@ -36,7 +36,7 @@ public class GameSettings {
private Properties prop;
private File settings;

private int version = 3;
private int version = 4;

public GameSettings() {
settings = new File(VoxelVariables.settings);
Expand Down Expand Up @@ -98,10 +98,7 @@ public void registerValue(String key, String data) {

public String getValue(String key) {
String res = prop.getProperty(key);
if (res == null)
return "1";
else
return res;
return res;
}

private int getVersion() {
Expand Down
Expand Up @@ -44,7 +44,7 @@ public class Channel {
/**
* Global identifier for the type of channel (normal or streaming). Possible
* values for this varriable can be found in the
* {@link paulscode.sound.SoundSystemConfig SoundSystemConfig} class.
* {@link net.guerra24.voxel.client.sound.SoundSystemConfig SoundSystemConfig} class.
*/
public int channelType;

Expand Down
Expand Up @@ -195,6 +195,9 @@ public void update(float delta, GameResources gm, IWorld world) {
multiplierMovement = 120 * delta;
}

velocityComponent.x = Maths.clamp(velocityComponent.x, -2, 2);
velocityComponent.z = Maths.clamp(velocityComponent.z, -2, 2);

if (isKeyDown(Keyboard.KEY_Y)) {
System.out.println(positionComponent.toString());
System.out.println(velocityComponent.toString());
Expand Down
Expand Up @@ -34,7 +34,6 @@

import net.guerra24.voxel.client.world.IWorld;
import net.guerra24.voxel.client.world.block.Block;
import net.guerra24.voxel.client.world.entities.Camera;
import net.guerra24.voxel.client.world.entities.CollisionComponent;
import net.guerra24.voxel.client.world.entities.PositionComponent;
import net.guerra24.voxel.client.world.entities.VelocityComponent;
Expand Down Expand Up @@ -101,17 +100,13 @@ public void update(float deltaTime) {
if (ya == Block.Water.getId())
if (velocity.y < 2)
velocity.y = -2;
else if (velocity.y > 2)
velocity.y = 2;

if (yb != 0 && !(entity instanceof Camera)) {
if (yb != 0 && yb != Block.Ice.getId()) {
velocity.x *= 0.8f;
velocity.z *= 0.8f;
} else if (yb != 0 && entity instanceof Camera) {
if (!((Camera) entity).isMoved) {
velocity.x *= 0.8f;
velocity.z *= 0.8f;
}
} else if (yb == Block.Ice.getId()) {
velocity.x *= 0.95f;
velocity.z *= 0.95f;
}

collison.boundingBox.set(new Vector3(position.position.x, position.position.y, position.position.z),
Expand Down
Binary file modified src/main/resources/assets/textures/blocks/blocks_height.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/test/java/net/guerra24/voxel/test/BasicTests.java
Expand Up @@ -17,7 +17,7 @@ public void testVariables() {
assertEquals(0.1f, VoxelVariables.NEAR_PLANE, 0.0001);
assertEquals(1000f, VoxelVariables.FAR_PLANE, 0.0001);
assertEquals("assets/game/settings.conf", VoxelVariables.settings);
assertEquals("http://guerra24.github.io/", VoxelVariables.web);
assertEquals("https://guerra24.github.io/", VoxelVariables.web);
}

@Test
Expand Down

1 comment on commit 9bd9a2b

@Guerra24
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FAIL AGAIN, its build 152.

Please sign in to comment.