From a7f77c115bc95eb8a667df1146cc26dc17367879 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Wed, 22 Jan 2025 00:40:57 +0500 Subject: feat: player jumps like a frog!!! (FROGartha reference) + player state --- .../ilotterytea/frogartha/domain/PlayerState.java | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 shared/src/main/java/kz/ilotterytea/frogartha/domain/PlayerState.java (limited to 'shared/src/main/java/kz/ilotterytea/frogartha/domain/PlayerState.java') diff --git a/shared/src/main/java/kz/ilotterytea/frogartha/domain/PlayerState.java b/shared/src/main/java/kz/ilotterytea/frogartha/domain/PlayerState.java new file mode 100644 index 0000000..15ba015 --- /dev/null +++ b/shared/src/main/java/kz/ilotterytea/frogartha/domain/PlayerState.java @@ -0,0 +1,42 @@ +package kz.ilotterytea.frogartha.domain; + +import com.badlogic.gdx.math.Vector3; + +public class PlayerState { + private final Vector3 position, direction; + private float nextJumpTimestamp; + + public PlayerState() { + this(new Vector3(), new Vector3()); + } + + public PlayerState(Vector3 position, Vector3 direction) { + this.position = position; + this.direction = direction; + this.nextJumpTimestamp = 0; + } + + public Vector3 getPosition() { + return position; + } + + public void setPosition(float x, float y, float z) { + this.position.set(x, y, z); + } + + public Vector3 getDirection() { + return direction; + } + + public float getNextJumpTimestamp() { + return nextJumpTimestamp; + } + + public void setNextJumpTimestamp(float nextJumpTimestamp) { + this.nextJumpTimestamp = nextJumpTimestamp; + } + + public void setDirection(float x, float y, float z) { + this.position.set(x, y, z); + } +} -- cgit v1.2.3