summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-01-22 21:17:25 +0500
committerilotterytea <iltsu@alright.party>2025-01-22 21:17:25 +0500
commit80e7342650a9d71b73a838230733c54c50ffcc1b (patch)
treeb555c40ef4d15f493f2df7b6b7fe527087c4a58f /server
parentcbcb7b4bebeadd3f61e2f0c6071a000827188887 (diff)
upd: Vector2 instead of Vector3 for directions (because we don't actually need the y coordinate)
Diffstat (limited to 'server')
-rw-r--r--server/src/main/java/kz/ilotterytea/frogartha/server/ServerHandlers.java7
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());