From 1136a9b8b8606eafe868ce93c36c011901a061b7 Mon Sep 17 00:00:00 2001 From: Jeasonfire Date: Sun, 10 May 2015 01:14:08 +0300 Subject: [PATCH] Fixed bug where player tripped out when standing on ground. --- .../com/saltosion/gladiator/systems/PhysicsSystem.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/com/saltosion/gladiator/systems/PhysicsSystem.java b/core/src/com/saltosion/gladiator/systems/PhysicsSystem.java index 4a40284..1a4a0fd 100644 --- a/core/src/com/saltosion/gladiator/systems/PhysicsSystem.java +++ b/core/src/com/saltosion/gladiator/systems/PhysicsSystem.java @@ -30,6 +30,9 @@ public class PhysicsSystem extends EntitySystem { for (int i = 0; i < entities.size(); i++) { CPhysics obj = pm.get(entities.get(i)); + // Apply movement + obj.position.add(obj.velocity); + // Movement if (obj.movable) { float move = 0; @@ -62,9 +65,6 @@ public class PhysicsSystem extends EntitySystem { collision(entities.get(i), entities.get(j)); } } - - // Apply movement - obj.position.add(obj.velocity); } } @@ -116,7 +116,7 @@ public class PhysicsSystem extends EntitySystem { cp0.velocity.y = 0; } cp0.grounded = true; - cp0.position.y += (y11 - y00) * 1.1f; + cp0.position.y += y11 - y00; if (cp0.collisionListener != null) { cp0.collisionListener.collision(CollisionSide.BOTTOM, entity0, entity1);