diff options
Diffstat (limited to 'server')
| -rw-r--r-- | server/src/main/java/kz/ilotterytea/frogartha/server/ServerHandlers.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/server/src/main/java/kz/ilotterytea/frogartha/server/ServerHandlers.java b/server/src/main/java/kz/ilotterytea/frogartha/server/ServerHandlers.java index 621affd..6f16281 100644 --- a/server/src/main/java/kz/ilotterytea/frogartha/server/ServerHandlers.java +++ b/server/src/main/java/kz/ilotterytea/frogartha/server/ServerHandlers.java @@ -1,5 +1,6 @@ package kz.ilotterytea.frogartha.server; +import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.math.Vector3; import kz.ilotterytea.frogartha.FrogarthaConstants; import kz.ilotterytea.frogartha.domain.Identity; @@ -54,7 +55,7 @@ public class ServerHandlers { Vector3 startPosition = position.cpy(); float jumpDistance = action.getJumpStrength() * FrogarthaConstants.Player.JUMP_SPEED; - Vector3 d = new Vector3(state.getDirection()).sub(startPosition).nor(); + Vector3 d = new Vector3(state.getDirection().x, state.getPosition().y, state.getDirection().y).sub(startPosition).nor(); Vector3 endPosition = new Vector3( position.x + d.x * jumpDistance, @@ -79,9 +80,9 @@ public class ServerHandlers { } PlayerState state = player.getState(); - Vector3 direction = action.getDirection(); + Vector2 direction = action.getDirection(); - state.setDirection(direction.x, state.getPosition().y, direction.z); + state.setDirection(direction.x, direction.y); ChangedDirectionEvent event = new ChangedDirectionEvent(player.getId(), state.getDirection()); |
