From 814f9c978802b9fc9eb559d3b645bfd2a096dbf1 Mon Sep 17 00:00:00 2001 From: Jeasonfire Date: Mon, 18 May 2015 01:05:47 +0300 Subject: [PATCH] Increased physics precision & cleanup. --- core/src/com/saltosion/gladiator/level/LevelFactory.java | 8 ++++---- .../com/saltosion/gladiator/systems/PhysicsSystem.java | 2 +- .../com/saltosion/gladiator/systems/RenderingSystem.java | 1 - 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/core/src/com/saltosion/gladiator/level/LevelFactory.java b/core/src/com/saltosion/gladiator/level/LevelFactory.java index 4e4fc50..599a175 100644 --- a/core/src/com/saltosion/gladiator/level/LevelFactory.java +++ b/core/src/com/saltosion/gladiator/level/LevelFactory.java @@ -79,14 +79,14 @@ public class LevelFactory { Entity borderLeft = new Entity(); CPhysics borderLeftPhysics = new CPhysics().setMovable(false).setGravityApplied(false) - .setProcessCollisions(false).setSize(0.1f, 20); - borderLeftPhysics.setPosition(-xClamp - borderLeftPhysics.getSize().x, 0); + .setProcessCollisions(false).setSize(1f, 20); + borderLeftPhysics.setPosition(-xClamp - borderLeftPhysics.getSize().x / 2, 0); borderLeft.add(borderLeftPhysics); AppUtil.engine.addEntity(borderLeft); Entity borderRight = new Entity(); CPhysics borderRightPhysics = new CPhysics().setMovable(false).setGravityApplied(false) - .setProcessCollisions(false).setSize(0.1f, 20); - borderRightPhysics.setPosition(xClamp + borderRightPhysics.getSize().x, 0); + .setProcessCollisions(false).setSize(1f, 20); + borderRightPhysics.setPosition(xClamp + borderRightPhysics.getSize().x / 2, 0); borderRight.add(borderRightPhysics); AppUtil.engine.addEntity(borderRight); } diff --git a/core/src/com/saltosion/gladiator/systems/PhysicsSystem.java b/core/src/com/saltosion/gladiator/systems/PhysicsSystem.java index 6d5a6e8..f21a458 100644 --- a/core/src/com/saltosion/gladiator/systems/PhysicsSystem.java +++ b/core/src/com/saltosion/gladiator/systems/PhysicsSystem.java @@ -13,7 +13,7 @@ import com.saltosion.gladiator.util.Log; public class PhysicsSystem extends EntitySystem { - private static final float MAX_VEL = 1.75f, COLLISION_PRECISION = 12f, UPDATES_PER_SECOND = 240f; + private static final float MAX_VEL = 1.75f, COLLISION_PRECISION = 12f, UPDATES_PER_SECOND = 300f; private static final ComponentMapper pm = ComponentMapper.getFor(CPhysics.class); private static final ComponentMapper cm = ComponentMapper.getFor(CCombat.class); diff --git a/core/src/com/saltosion/gladiator/systems/RenderingSystem.java b/core/src/com/saltosion/gladiator/systems/RenderingSystem.java index 7bd1b94..88da657 100644 --- a/core/src/com/saltosion/gladiator/systems/RenderingSystem.java +++ b/core/src/com/saltosion/gladiator/systems/RenderingSystem.java @@ -425,7 +425,6 @@ public class RenderingSystem extends EntitySystem { debugRenderer.dispose(); particleRenderer.dispose(); font.dispose(); - SpriteLoader.dispose(); } private class TextObject {